Question: I need help, would you please use Java to write the code and run the output for me. Objective: Write a program that keeps track

I need help, would you please use Java to write the code and run the output for me.

Objective:

Write a program that keeps track of a schedule for a day. Create the following.

A class ActivityInstance Variables

Name

Start Hour (Assumed to be in military time 0-23 hours)

End Hour (Assumed to be in military time 0-23 hours)

Constructors

Default

Parameterized with error checking

Accessors and Mutators for each instance variable. DONT FORGET TO CHECK FOR VALID VALUES

Other methods

toString: takes in the value and returns a string with the name, start hour, and end hour

A class DayScheduleInstance Variables

Activities: an array of Activity that represents the current schedule.

Constructors

Default

Accessors and Mutators for the instance variable

Other methods

addActivity: This method takes in an instance of an activity and attempts to add it to the current array of activities. It only adds this activity if the array is not full, and this activity doesnt conflict with another one. An activity conflicts if the start and the end of one activity cannot fall at the same time as another. If this were to occur the user should be notified and the activity is not added. Also this method should finally sort the activities based on their starting time.

removeActivity: This method takes in a string that represents the name of an activity and then searches for that activity in the array. If it is found then that activity is removed, but if its not found then the user is prompted that it does not exist.

printActivities: This method simply prints out the activities including their name and their times.

A class DayScheduleFrontEnd

This class contains the main method which has an instance of DaySchedule. From there it prompts the user for whether or not they want to add a new activity, remove an activity, and quit. Also it should display the current list of activities in that instance. See the example dialog below for further guidance.

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!