Practical Exercise 6 using BlueJ

Note that this exercise is based on Barnes and Koelling, Objects First, Chapter 6.

Before starting these exercises copy (right click then save as) projects.zip to your home directory (e.g.Z:\My Documents) and unzip it.

Main Exercise:

    Diary Prototype

  1. Create three Appointment objects each of one-hour duration
  2. Use the three objects to make appointments at 9am, 1pm and 5pm
  3. Call showAppointments to confirm that it prints correctly
  4. Check that the hour cannot be double booked
  5. Check boundary behaviour - what happens when making appointments at 8am and 6pm?
  6. Create further appointments so that the day is completely full
  7. Check output of showAppointments is correct
  8. Is it possible to re-use the same appointment object at different times of the day?
  9. Try repeating the same tests on appointments lasting two hours instead of one hour. What errors can you report?