Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Implement a superclass called Appointment and subclasses OneTime, Daily, Weekly,

ID: 3534606 • Letter: I

Question

Implement a superclass called Appointment and subclasses OneTime, Daily, Weekly, and Monthly. An Appointment has a descriptionand a date and time. Write a method occursOn(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then, in a TestAppointment class, fill an array of Appointment objects with a mixture of different kinds of appointments. Ask a user to enter a date and print out all appointments that occur on that date.


B. Improve your Appointment program by giving the user the option to add new Appointments. The user must specify the type of the appointment, the description, and the date and time.


As always, the source code must be indented properly and contain comments that describe important parts of the algorithm.

Explanation / Answer

Appointment findDate( String date ) { if( this.date = date )return this; return null; } public Appointment findDesc(description string) { if( this.description = description ) return this; return null; } TestAppointment has a datastore, such as ArrayList alist = ArrayList(). You go through that a list Appointment detail = null; for( Appointment a : alist ) { if( a.description( "dentist" ) != null ) detail = a; break;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote