Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java program for the below instruction: please you basic level programing for the program. 2. Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly.

java program for the below instruction:

please you basic level programing for the program.

2. Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly.

3. Make sure the appointment has a description (for example, see the dentist) and occurs on one or more dates.

4. Write a method occursOn(Date d) that checks whether the appointment occurs on that date. For a monthly appointment, you must check whether the day of the month matches.

5. Appointment class must implement Recurring interface. It contains the repeat method.

6. When the repeat method is called on a Daily appointment object, get the number of occurrences from the user and add all continuous dates until the end date of the list of dates. Tip: It is good practice not to have user input only in the main function and not to add it to other member functions.

7. When the repeat method is called on a Monthly appointment object, get the number of occurrences from the user and add the same date of consecutive months until the end date of the list of dates.

8. When the repeat method is called on a Onetime appointment object, print a message that says, One-time appointments cannot be repeated. Sorry.

9. Add an abstract method cancelAppointment to Appointment. The subclasses must override this and empty the list of dates. For Daily appointments, print a message that says, Daily appointment is cancelled. Change the message accordingly for other subclasses.

10. Use the class SchedulingAssistant as your tester/main class. Then fill an array of Appointment objects with a mixture of appointments (Onetime, Daily, and Monthly appointments).

11. Prompt the user to enter a date and print out all appointments that occur on that date.

12. Give the user the option to add new appointments. The user must specify the type of the appointment, the description, and the date.

13. Iteratively ask if the user wishes to add an appointment or view appointments on a specific date until they wish to exit. Implement this using a do-while loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions