Create a class named DentalAppointment. Include fields for a patient’s data (use the Person class from Exercise 3), the date (using the Date class from Exercise 2), the time (use the Time class from...



Create a class named DentalAppointment. Include fields for a patient’s data (use the


Person class from Exercise 3), the date (using the Date class from Exercise 2), the time


(use the Time class from Exercise 4), and the duration of the appointment in minutes.


Also include a field that contains the ending time of the appointment; this field will be


calculated based on the start time and the duration using the Time class function that


adds minutes to a Time object. The DentalAppointment constructor requires a first


and last name, and a month, day, year, hour, and minute for the appointment. Allow a


DentalAppointment to be constructed with or without an additional argument for


appointment duration, and force the duration to 30 minutes when no argument is supplied.


The constructor does not allow any appointment over 240 minutes. The constructor


calculates the appointment ending time based on the start time and the duration. Also


include a display function for the DentalAppointment class. Write a main()function


that loops at least three times, prompting the user for DentalAppointment data and


displaying all the information. (Note, if you use the Person class display function, the zip


code will be “X”; this is acceptable.) Figure 8-35 shows the output after a typical patient


has been entered. Save the file as DentalAppointment.cpp.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here