Practical Exercise 3 using BlueJ
Note that this exercise is based on
Barnes and Koelling, Objects First, Chapter
Before starting these exercises copy (right click then save as)
projects.zip to your home directory (e.g.Z:\My Documents) and unzip it.
- Start BlueJ and open the project named clock-display (see under chapter 3)
- Compile and create a new instance of the class ClockDisplay
- Find out what the class does by testing the methods.
- Try setting the clock value to something absurd. What happens? Why?
- Is there a better way of dealing with illegal values?
- Does the GetDisplayValue method work well in all circumstances? When does it fail?
- 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.
- Load and compile the project mail-client
- Create an instance of MailServer. Create several MailClients, one for yourself and one or two others for other csa0080 students.
- Send and receive messages with the MailCLient methods
- Experiment with the debugger. Be sure to try single step and
- Add a subject-line for an email to mail items in the mail-system project. Ensure that printing messages also prints the subject line.