Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(JAVA PROGRAMMING) I have to fill out this program. The instructions are in the comments and they are also below the code . I provided

(JAVA PROGRAMMING) I have to fill out this program. The instructions are in the comments and they are also below the code . I provided the skeleton below! Thank you

package appointmentsapp;

/** * * @author Cristy */ public class AppointmentsApp { public Appointment[] myAppointments; public int currentSize = 0; /** * @param args the command line arguments */ public static void main(String[] args) { AppointmentsApp myApp = new AppointmentsApp(); //call 2 methods: // myApp.makeAppointments(); // myApp.checkAppointments();

} //In the makeAppointments method, do the following: /** * * * How many appointments do you wish to make? 3 * * Use the number entered by user to instantiate the array of appointments to that size. * * Create a menu for-loop as follows: Please make a selection: 1. One Time Appointment 2. Daily Appointment 3. Monthly Appointment * * For Each option, call a specific method that will request the appropriate data from the user, * and then instantiate the appropriate class/subclass in the Appointment hierarchy * For each appointment made, you will add it to the global array of appointments at the currentSize, * and increment a currentSize global variable that keeps track of the next empty slot in the array. * * * * * //In the checkAppointments method, do the following: * Inside a do-while loop, ask the user the following questions: * What is the date you wish to look up in your Appointments' Calendar? Enter the month: 03 Enter the day: 15 Enter the year: 2017 * (Display the result in the following format:) * * On 3 / 15 / 2017 you have the following appointments: Dentist appointment with Dr. Smith at 13:30 Piano Lessons with Ms. Katie at 17:30 Athletic Training with Ms. Jones at 10:00

Do you wish to look up another date? (If they answer NO, exit the program with message) Thank you for using your appointment calendar.

(If they answer YES, continue to loop.

*/ } }

In the driver class:

Code 2 methods:

1. Make Appointments - Fills an array of Appointment objects, with a mixture of appointments and dates and times.

2. Check Appointments - Asks the user to enter a specific date, and print out all the appointments that occur on that date.

Make sure you implement the polymorphic method occursOn() that can be called by any of the objects in the Appointment array.

A sample of the output of the program is as follows:

How many appointments do you wish to make? 3 Please make a selection: 1. One Time Appointment 2. Daily Appointment 3. Monthly Appointment 1 What is the description of your appointment? Dentist Checkup

What is your persons name? Dr. Smith

What year is your appointment? (2017 - 2018) 2017

What month is your appointment? (1 - 12) 03

What day is your appointment? (1 - 31) 15

What is the hour of your appointment? (00 23) 13

What is the minutes of your appointment? (00 59) 30

Appointment added with Dr.Smith on 03/15/2017 at 13:30

Please make a selection: 1. One Time Appointment 2. Daily Appointment 3. Monthly Appointment -----------------------------------------------

2 What is the description of your appointment? Athletic Training

What is your persons name? Ms. Jones

What is the hour of your appointment? (00 -23) 10

What is the minutes of your appointment? (00 -59) 00

Appointment added with Ms. Jones Daily at 10:00

Please make a selection: 1. One Time Appointment 2. Daily Appointment 3. Monthly Appointment

------------------------------------------------

3 What is the description of your appointment? Piano Lessons

What is your persons name? Ms. Katie

What day of the month is your appointment? (1 - 31) 15

What is the hour of your appointment? (00 -23) 17

What is the minutes of your appointment? (00 -59) 30

Appointment added with Ms. Katie Monthly on day 15 at 17:30

*************Thank you for making all of your appointments.***************** Loop with the following: What is the date you wish to look up in your Appointments' Calendar? Enter the month: 03 Enter the day: 15 Enter the year: 2017 On 3 / 15 / 2017 you have the following appointments: Dentist appointment with Dr. Smith at 13:30 Piano Lessons with Ms. Katie at 17:30 Athletic Training with Ms. Jones at 10:00 Do you wish to look up another date?

(If they answer NO, exit the program with message) Thank you for using your appointment calendar. (If they answer YES, continue to ask for another date to look up). What is the date you wish to look up in your Appointments' Calendar? Etc.

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 Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions