Question: 2 The University Model In this assignment we will develop an object-oriented model for a university which extends our earlier work. The requirements from earlier







2 The University Model In this assignment we will develop an object-oriented model for a university which extends our earlier work. The requirements from earlier work for students, professors, classrooms, courses, and departments, which are relevant to this assignment, are reproduced at the end of this document for reference. Having developed a working model of a university for the previous assignment, in this assignment (i) we will use inheritance to enhance code reuse and improve structure of code (ii) add new classes OnlineCourse, CampusCourse, Employee, Staff with unique functionalities for each. In developing the university program, you need to carefully note all the requirements below to identify what you need to implement (and what changes should be made to the previous classes for students, courses, and departments). The extended requirements include: Person: 0 Each Person will have a name, a schedule, a campus course list, an online course list. 0 There are 2 kinds of Persons: Students and Employees 0 Person class will 0 be the parent class of the Student, and Employee classes 0 Implement the concrete detectCoanict(CampusCourse aCourse) method that returns a boolean true if a schedule conict is detected with the course aCourse. 0 Implement the concrete printScheduleO method to print this person's schedule. 0 declare abstract methods addCourse(CampusCourse cCourse) and addCourse(On|ineCourse oCourse) methods which should be implemented by its subclasses Student: In addition to the before mentioned, students will belong to a department he a subclass of Person have additional elds: units completed, total units needed for degree completion, currently enrolled credits, and tuition fee. have a method to calculate remaining credit for degree completion implement the addCourse(CampusCourse cCourse) and addCoursetOnlineCourse oCourse) methods. 0 addCourse(CampUSCourse cCourse) need to use detectConict from the person class to check if there is a conict and use the availableTo(Student aStudent) from CampusCourse class to check if this course is available for this student (see the CampueCourse class description). If the course is added, this method, also adds the course's number of credits to the student's enrolled credits. 0 addCourse(On|ineCourse oCourse) uses the availableTo(Student astudent') om OnlineCourse class to check does this course available for this student (see the OnlineCourse class description). If the course is added, this method, also adds the course's niunber of credits to the student's enrolled credits. have a method to calculate the total tuition fee. Tuition fee depends on the courses taken by student. (On campus fee plus online fee) 0 On campus fee = Number of credits enrolled on campus * 300 0 Online fee = Flat $2000 for every online course that is 3 credits and $3000 if the online course is 4 credits. have a method a dropCourse(CampusCourse cCourse) which should rst check to see if the course is in the student's course list. If it is, then only in dropCouree(CampusCourse cCouree) method, you should check if the student has one or more online courses. This student needs to have at least 6 credits for campus courses after the student drops this campus course to hold on to the online courses. If the student will not have at least 6 campus course credits after dropping this campus course, you need to print \"'student name' can't drop this CampueCourse, because student don't have enough campus course credit to hold online courses". (check output les for more details) After checking the condition in dropCourse{CampusCourse cCourse) method, if there are enough credits, the course should be removed om the student schedule. Also if the student is not enrolled in the cCourse, an error message should be printed out: \"The course 'course name' could not be dropped because 'student name\" is 3- not enrolled in \"course name . (check output les for more details). have a method a dropCourse(OnlineCourse oCourse} which should rst check to see if the course is in the student's course list. If the student is enrolled in oCourse, then the course should be removed om the student schedule, otherwise an error message should be printed out: \"The course \"course name' could not be dropped because 'student name' is not enrolled in 'course name . (check output les for more details). Employee: Professor: will be a subclass of Person (as entioned). Employees can be either Professor or Staff. will have an abstract method called eams() that needs to be implemented in the children will have an abstract method called raise (double percent) needs to be implemented in the children. has a eld salary, its value is how much professor earn for each year. Professors can sign up to teach courses 0 when a professor signs up, her' she should be listed under the course info, and reciprocally helshe should have the course in his schedule (and have access to course info). 0 there can be only one professor for each course, but professors can teach multiple courses 0 If a professor is assigned to a course that already has a professor, an error message should be printed: \"The professor cannot be assigned to this course, because professor 'pl'ol'essor name' is already assigned to an the course 'eoul'se name . (check outputs le for more detail of print). . professors are associated with a university department - professors earn salaryt26 for every pay period. 0 In the raise method, salary is raised by a percentage. 0 implement the addCourseCampusCourse eCourse) and addCourse(OnlineCourse oCourse) methods. 0 addCourse{CampusCourse cCourse) needs to use detectConflict from person class to check for possible conicts. Staff: The staffs are also university employees, but they may be working part time. Staffs o are associated with a university department 0 have a field for payRate (hourly rate in S). 0 have hoursWorked eld (monthly) as they can be part time o A staff earns hoursWorked * payRate (per pay period). 0 have a field for tuition fee. 0 have a method to calculate the total tuition fee. Tuition fee depends on the course taken by the staff. (On campus fee or online fee) i. On campus fee = Number of credits enrolled on campus * 300 ii. Online fee is at $2000 if online course is 3 credits and $3000 if the online course is 4 credits. 0 In raise method, payRate is raised by percentage. 0 can sign up to take a class (implement addCourseO), but allowed to take no more than one course at a time and the last course signed up overwrites any previously signed-up course (You should report a warning when this happens check outputl for more detail). Course: Each course has a name, a department it belongs to, a course number, roster of students taking the course and a Professor who teaches the course, number of credit units for this course. It is the parent class of CampusCourse and OnlineCourse classes. The university offers two kinds of courses: On campus courses, and online courses. A concrete method addStudentToRosterO to add a student or a staff to the course's student roster. An abstract method availableTo(Student aStuclent) will return true or false. Its implementation should indicate whether the given course is available for this student (aStudent). Needs to be implemented in CampusCourse and OnlineCourse classes. CampusCourse: Will have elds, max number of student in this course, schedule, and a classroom where the course meets. CampusCou rse will have a Classroom assigned; therefore, before this assignment is done, it should be checked to make sure that no two classes which take place at the same time are assigned to the same classroom as this will cause a scheduling conict for that classroom. Such classroom assignment conicts should be detected and prevented. Campus courses with overlapping meeting times should have different classrooms assigned. A classroom's printSchedule method should print the times and the courses scheduled in that room chronologically day by day (see driver outputs). CampusCourse's printSchedule should print what times the course meets. A CampusCourse is available to a student if the course has not reached its max number of students that can enroll (enrollment limit). OnlineCoul'se: An OnlineCoulse does not have a schedule or classroom associated with it. It will also not have printSchecluleO method. 0 An OnlineCourse will be available to a student only if the student has enrolled for a_t least 6 units of on campus courses. If the student has not signed up for 6 campus course units and tries to sign up for an OnlineCourse, an error message should be printed saying \"Student 'student name' has only \"number of campus units' enrolled. Students should have at least 6 units registered before registering for online courses.\" (check outputs les). ClassRoom: o A classroom's printScheduleO method should print the times and the courses scheduled in that room chronologically day by day (see driver outputs). Additional Requirements (Departments, Classrooms, Etc): Students, professors, and staff should all have printScheduleO method. It should print the schedule for that person chronologically day by day for campus courses and list the online courses the person is enrolled in (see the driver outputs). You should be able to report the number of total online course credits and total campus course credits being taken when asked. The university also has departments, and classrooms. Note the requirements below: 0 Each department will offer Courses. 0 A department is able to report its students, professors, staff, and courses, using its p_. p 13. and p (Prints both campus and online courses) methods. The University class: 0 The class University keeps track of the departments and the class rooms in the University (may consider ArrayLists of relevant classesfobj ects mentioned above). o The University class will also have methods named printStudentList, p, , p_, and p (Prints both campus and online courses) to report enrolled students, professors, working sta, and the list of courses at the university. Create Three Packages to Group Classes as below Create three packages to organize the classes in the university program. Name these packages as follows and place the classes accordingly: I org.university.hardware ( multi-level package) will contain 0 Classroom, Department classes I org.university.people package will contain 0 Person, Employee, Student, Professor and Staff classes I org.university.software package will contain 0 Course, CampusCourse OnlineCourse, University and one of the Drivers C mentioned below) 3 Drivers and Testing To guide you and make the assignment clearer, a couple of Drivers and their expected execution results are provided. These drivers should be used for testing. We also use them as part of our grading (but the grading will not be limited to these two test drivers alone). You need to make sure your implementation will run against both of these drivers and produces same results as shown. Print schedules in the day and time format (Monday 8:00am to 9:15am, See the expected outputs from the drivers). The drivers are to help you but every detail is not be in these Driver classes, so you must think and deduce based on the specied requirements for the model what elds and methods should be implemented for each class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
