Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction This program will require you to create a program that will allowfaculty members to post their course and office hourschedules. Enumeration First of all,

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

Introduction This program will require you to create a program that will allowfaculty members to post their course and office hourschedules. Enumeration First of all, this project utilizes enumerated types which help your program's readability. Here is an example: public enum DaysOfWeek { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY; } The code above would appear in a separate file named DaysOfWeek.java and would serve as the data type for variables that could only have the values: 'SUNDAY, MONDAY', 'TUESDAY, WEDNESDAY, 'THURSDAY, FRIDAY , SATURDAY . Notice, these are not Strings! Internally, 'SUNDAY=O', MONDAY=1', TUESDAY=2", 'WEDNESDAY=3', 'THURSDAY=4', 'FRIDAY=5', 'SATURDAY=6'. However, the enumerated type is more elegant way of representing these values. The following examples should also prove helpful to you: DaysOfWeek firstDayOfWeek = DaysOfWeek.SUNDAY;| You can also retrieve the String value of an enumeration. The following example would give the String 'value the value ""SUNDAY": String value = firstDayOfWeek.name(); UML Class Diagrams Here are the UML Class Diagrams for the classes you must implement in Java. You are free to add additional private methods if needed. -day:DaysOfWeek -startTime:int -end Time:int -comments:String -location:String +TimeBlock() +//mutator and accessor methods +getFormatedTimeBlock(): String +toString():String TimeBlock Day of time block Start time of block End time of block Comments about time block. Location where the time block is spent Set defaults See Comment below. Use same format as the input file. The method 'getFormatedTimeBlock() should return a string in the following format: startTime - endTime comments location (e.g. 1200 - 1300 COMP167 ACB 207 ) -description:String -timeBlock:TimeBlock Appointment Description of the appointment day and times of appointment. Set defaults and instantiate the TimeBlock +Appointment() +//mutator and accessor methods +toString():String Use same format as the input file. -courseName:String -location:String -timeBlocks:ArrayList Course Course name Building and room number where course is conducted Course days and meeting times. Set defaults and instantiate the ArrayList +Coursel) +//mutator and accessor methods +toString():String Use same format as the input file. -first Name:String -lastName:String -officeLocation:String -courses:ArrayList -office Hours:ArrayList -appointments:ArrayList Faculty Faculty first name Faculty last name Campus building and office number Information on courses taught. Information on office hour sessions. Information on miscellaneous appointments and meetings. +Faculty() +//mutator and accessor methods +getCalendar(): String +toString():String Set defaults and instantiate the ArrayList See "Handling ArrayList" See note below. Use same format as the input file. The methodgetCalendar() shouldreturn all course items, office houritems and appointmentitems. Each item(i.e. formatted TimeBlock) should be listed under aheading with the day oftheweek. Within aparticularday, the items should be listedinsortedorderbytime (Hint: Sortingisnotnecessary--usea loop that goes from 5 to 2400 by 5's.). -departmentName:String -unit Name:String -university Name:String -faculty:ArrayList Department Name of the department (e.g. Computer Science) Name of the unit/college (e.g. Engineering) Name of the University All of the faculty in the department +Depatment() Default values for properties, instantiate each ArrayList See "Handling ArrayList" section +//mutator and accessor methods +loadDepartmentData( String inputFileName) : void +SaveDepartment Datal String outputFileName): void +atGlance int time) : String Read in the bank data from a file (See note below on input file) Write bank data to a file (See note below on output file). Returns a string showing what each Faculty member is doing at the given time. Creates a string with all Department that matches the format of the input file (See input file section). +toString():String The toString() method The toString method should return a String formatted as in the input file. Notice that TimeBlock.toString() will not include the location or comment properties. Most classes will have each property on a new line, TimeBlock properties will be separated by a comma. Handling ArrayLists Each ArrayList should have five associated methods to perform: getNum, add, get, set and remove. So if you have an ArrayList named widgets that stored items of type Widget, then the associated UML would be: +getNumWidgets() : int //Return the number of items in the ArrayList widgets. +getWidget(index:int) : Widget //get the Widget at location index in ArrayList widgets +SetWidget(index:int, item: Widget):void // store item at location index in the ArrayList widgets. +removeWidget(index:int):Widget //remove the Widget stored at the given index and return it +addWidget(item:Widget):void //Append the Widget to the ArrayList. Input File The input file will be read by the user using any file reader and input streams (Buffered Reader or Scanner) to your main() method using command-line arguments. The format for the input file is shown below: Department Name College Name University Name Facultyo First Name Facultyo Last Name Faculty Office Location Faculty Number of Courses Course Name Course Location Course Number of meeting days Course Day of the week, Start_Time, End_Time * repeat for other days * repeat for other courses Facultyo Number of office hour sessions Office Hours Day of the week, Start_Time, End_Time * Repeat for other office hours. Faculty Number of Appointments Appointments Description Appointments Day of the week, Start_Time, End_Time * Repeat for other appointments. * Repeat for other faculty The file will end when there are no more faculty. You should also reference the input file provided in this repository. Notes When outputting office hour information, use the string "Office Hours" as a description. All start and end times will be a multiple of 5. Output File The format of the output file is the same as the input file. If you have created the toString() method for the Department class correctly, the produced String should match the input/output format. This should make this method trivial to write. Grading Level 1: 25 points Complete the DaysOfWeekenumerated type, the TimeBlock class, the Course class and the Appointment class. Write a simple driver program that will instantiate an object of each class type, populate the data fields and test the other methods of the classes. Display your output. Level 2: 10 points Complete all of the Faculty class except for the getCalendar() and atGlance() methods. Level 3: 20 points Complete all of the Department class except for the loadDepartmentData() and save DepartmentData() classes. Level 4: 30 points Implement the loadDepartmentData() and save DepartmentData() methods. Your main() method should be able to read from the input file. Level 5: 15 points Implement the getCalender() and atGlance() methods. Computer Science Department College of Engineering NC A&T State University Madhuri Siddula 503 McNair Hall 3 COMP167 Sections 1,2,3 & 4 Zoom 3 Monday, 1100, 1150 Wednesday, 1100, 1150 Friday, 1100, 1150 COMP121 Section 1 Zoom 2 Monday, 1500, 1615 Wednesday, 1500, 1615 4 Monday, 1330, 1430 Tuesday, 1300, 1600 Wednesday, 1330, 1430 Thursday, 1300, 1600 2 Eat Lunch Monday, 1300, 1330 Eat Lunch Wednesday, 1300, 1330 Kenneth Williams 503 McNair Hall 2 GEEN163 Sections 1 & 2 210 Graham Hall 3 Monday, 900, 950 Wednesday, 900, 950 Friday, 900, 950 GEEN163 Section 3 & 4 210 Graham Hall 3 Monday, 1000, 1050 Wednesday, 1000, 1050 Friday, 1000, 1050 3 Monday, 1200, 1600 Wednesday, 1200, 1400 Friday, 1400, 1700 0

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_2

Step: 3

blur-text-image_3

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

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions