Starting from:

$34.99

COMP90041 Lab 5 Solution


Workshop Instructions
Writing Java Class

2. Add two constructors to the Appointment class, including a default constructor and a constructor to initialise an Appointment to suitable arguments.

3. Write a driver program, say AppointmentDemo, that tests your Appointment class.

4. Rewrite the mutator method for setting the day in the Appointment class in a way that it has to use the this keyword.

5. Modify mutator methods for setting day, month and year so that only valid values for those instance variables are accepted. For instance, 29/2 is only valid in leap years. Then test the class again (using your driver class) and make sure that it still works and accepts valid values only.
Page 1 of 1

More products