[SOLVED] COMP90041 Lab 5-Writing Java Class

35.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

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

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.