Question: Java Create a class named Appointment that stores information about appointments. All times are military or 24 hour times. So 1:00 am is 100, and

Java

Create a class named Appointment that stores information about appointments. All times are military or 24 hour times. So 1:00 am is 100, and 1:00pm is 1300. The class must ensure that startTime and endTime instance variables are within the valid range of times (0 2359). If an invalid time is passed to the object, assign the time to -1 and print the following error message: Invalid time: the time must be between 0 and 2359.

Create a class named AppointmentTester that tests the Appointment class created in the previous question. The code must contain a main method and perform the following.

Create an object using the default constructor.

Create an object using the parameterized constructor.

Call both mutator methods.

Call the accessor method and printout that value.

Call the toString method and printout that value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!