Practical Exercise 3 using BlueJ

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

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:

    ClockDisplay

  1. Start BlueJ and open the project named clock-display (see under chapter 3)
  2. Compile and create a new instance of the class ClockDisplay
  3. Find out what the class does by testing the methods.
  4. Try setting the clock value to something absurd. What happens? Why?
  5. Is there a better way of dealing with illegal values?
  6. Does the GetDisplayValue method work well in all circumstances? When does it fail?
  7. Change the clock from a 24-hour clock to a 12-hour clock so that, for example, the time 01.15 appears as 1.15 am, 13.15 appears as 1.15 pm. Note that 00.30 should be written as 12.30 am.
  8. MailClient

  9. Load and compile the project mail-client
  10. Create an instance of MailServer. Create several MailClients, one for yourself and one or two others for other csa0080 students.
  11. Send and receive messages with the MailCLient methods
  12. Experiment with the debugger. Be sure to try single step and step-into commands.
  13. Add a subject-line for an email to mail items in the mail-system project. Ensure that printing messages also prints the subject line.