Download Programming Assignment 2 - Object Oriented Programming | COP 3330 and more Assignments Computer Science in PDF only on Docsity! Object Oriented Programming - Programming Assignment #2 Assigned: 2/6/07 (Tuesday) Due: 2/15/07 (Thursday) at 11:55pm WebCT time Objective 1. Utilizing pre-written classes 2. Creating multiple objects of a class. 3. Reviewing Java primitives Problem: Scheduler For this program you will use two prewritten classes, Event and Schedule. The files Event.class and Schedule.class will be posted on both the course web page and WebCT. You will need to download these files in order to complete the assignment. A document specifying the public methods of the Event class and Schedule class will also be posted on both WebCT and the course web page. Once you download it, you will simply leave this file in the same directory as the file that you create for this part of the assignment, Planner.java. In your program, you will allow the user to make and edit plans for two days of their schedule, Monday and Tuesday. (Your program will set up two empty Schedule objects for these days without getting any input from the user.) Your program will be menu driven and give the user the following choices: 1) Schedule an event. 2) Cancel an event. 3) Move a scheduled event. 4) Print the schedule for a day. 5) Print out how much time (in hours) is already scheduled. 6) Print out how much time (in hours) is free for scheduling. 7) Quit For each choice, you must first ask the user for which day (Monday or Tuesday) they want to execute the choice. For each choice here is what else you have to do: 1) Ask the user for the name of the event, and the time the event will occur. The time of the event will be specified by two integers in between 0 and 24, inclusive. These represent the starting time and ending time of the event, respectively, in hours. 0 is midnight of that day, 23 is 11pm, and 24 is midnight of the following day. You are guaranteed that the user will enter valid integers. Namely, they will be in increasing order in between 0 and 24, inclusive. Once you gather this information, add this event to the appropriate schedule. If the event conflicts with another scheduled that day, then tell the user that the event was not scheduled due to the conflict. 2) Ask the user the event's name. Cancel the event if it's in the schedule. If it's not, print out an error message and do nothing. 3) Ask the user for the name of the event, and the new starting and ending time of the event. Then, move this event in the appropriate schedule. If moving the event causes a conflict, print out an appropriate error message and do nothing. If the event isn't in the schedule do begin with, print out an error message stating so. 4) Ask the user for the day and print the corresponding schedule. 5) Ask the user for the day and print out the number of hours that are already scheduled for that day. 6) Ask the user for the day and print out the number of free hours for that day. In order to make your job easier, no error checking will be required. Assume that the user always entered logically valid input. Implementation Details You may NOT write any code for either the Schedule class or the Event class. You must use the .class files we provide. Thus, you are restricted to use the public methods in these classes and can not change how these methods work, or the set of methods accessible to you. Output Sample Included on WebCT and the course web page in the file planner.out Deliverables You must submit a solution to the program described above in a file named Planner.java over WebCT.