Info2: Exercise 02: Implementing CRC Cards
Pre-Lab
Please think through the following questions before coming to the lab. Write down your answers and bring them with you for pre-lab check-in.
- This exercise builds on the design you did last week using CRC cards.
- What properties should a data structure have that can model movie theater seats?
- Given an n x m matrix and a cell c in (r, c). How do I reference the neighboring cells in the same row? In the same column? How do I reference the diagonal cells?
Assignment
These are the required exercises for this week. We are going to see if we can get our minds back into Java-Mode. Work in groups of two, each of you hands in the same report. Remember to put both of your names on the report. Groups of three are only possible if one of the three is new, i.e. did not take Info 1 last semester. You can continue to use BlueJ, or move to Eclipse, if you wish.
- If you didn’t do Lab 01 together, decide which of your cinema booking systems you are going to use. If necessary, flip a coin. Why did you choose the one you did?
- Implement a prototype of your cinema booking system. You should be able to reserve n neighboring seats, calculate the total price for this reservation, delete a booking, and print out a seating plan that shows which seats are available. Don’t worry about making it beautiful - it is enough for it to work. We are just making prototypes!
- Did you end up using all of the classes you specified? Did you miss any classes? Discuss in your report! How did you test your system?
- Tooling: Using Packages in Eclipse If you have used Eclipse, make sure that all your code is within one or two or more neatly named packages, and you have at least one unit test. If you haven’t used Eclipse, introduce at least one package either to last week’s project or a new project.
For the bored:
- Sometimes people want special kinds of seats. The last two rows have loveseats, that is, two seats are connected with no armrest between them. Now offer your customers the possibility of reserving a loveseat, or a seat near an aisle or one in the middle. How will you define these conditions?
- Assume your theater is very large and is divided into sections, each accessable by an aisle. How do you have to adjust your seating plan and your conditions - is this hard or easy to do?
Lab Report / What to turn in
Your report is due the day before your next lab (for exact times, please refer to moodle).
As in Informatics 1, I am more interested in process than in product, although we are now getting more interested in products as well. Your report should include any collaborators on top of the first page, summarize what you learned, and note the time you invested in this exercise. Both of you need to upload the same report in PDF format to Moodle before the deadline.
Special Questions for your report
How many lines of code did you write for each class? Record this statistic in your report.