Requirement
Assignment 2: Course and Enrollment of OUSoft, and Stack Exercise
Due: 11:55PM 02/07
OUSoft is database software for managing people, class, enrollment, and organizations on a campus. You will create this software in this course and each component of the project will be one of the assignments. So you will incrementally add more functionality in each assignment and at the end of this course, you have the full software.
For the second component, we will add functionality of course management and student enrollment to the OUSoft project.
1). It will need a Course Java class, which includes information for a course such as course name, instructor, class meeting time, etc. The instructor field of a Course object should reference to a valid Instructor object. It will then need an Enrollment class that contains at least two fields, one for referencing to the Course object and one referencing to the Student object. Since we will build a linked list of the all enrollment objects, you will add an “Enrollment link” filed in the Enrollment class, the same approach as the LLNode class in the textbook. The idea for this design is that we will need an enrollment object for each record and the enrollment object only contains references to the course object and student object, which is the same principle as the relational database. (10 points)
2) It then needs a Course [] array and a linked list of Enrollment object, which we will name as allCourses and allEnrollment variables. The two variables could be part of the OUSoft class if you already have it, or other class that fit in your design in assignment 1. The class should provide at least the following methods: addCourse(Course course, Instructor instructor) (add a course to the allCourses array, a course that is added to the allCourse array must have an instructor), enroll(Student stu, Course course), withdraw(Student stu, Course course), numEnrollment(Course course) (number of students enrolled in this course), contains(Student stu, Course course) (check whether a student is enrolled or not), numCourses(Student stu) (number of courses a student is enrolled in), printEnrollment(Course courses) (print all the students who are enrolled in a course), and printCourses(Student stu) (print all the courses a student is enrolled in). Feel free to add other methods as you see fit and help you to implement the above methods. The program should only allow enrolling a student who is already in the OUPeople database and can only enroll a student in a course once. Please make sure your enroll methods check those condition and report necessary errors (or exceptions) to users. Feel free to reuse code segments of LinkedStringLog and LLStringNode classes from Chapter 02 of the textbook source code for your implementation. (30 points)
3). In your main program, add user interfaces for managing courses and enrollment. You will first need to create the course objects and feed in information for the course. Then you will prompt for user input for enrollment, which could be either student ID or student first and last name. You should also provide interfaces for reporting number of enrollment, listing the enrollment, and list the course information, etc. Try to make your interface and design from the perspective of users of your applications (30 points)
4). Exercise #30 of Chapter 3 from the textbook. This is not part of the OUSoft. (30 points)
Your submission should two files with “_Assignment_2” as file name prefix:
1.Source code
a.Source code should be compiled and executable. Please include comments in the sources. Grade will be given depending on the correctness, quality and clarity of the program.
b.Zip your IDE folder (not including Java classes) to one file.
2.A document with the following contents
a.UML diagram of the class and object in your application and screenshot of the execution showing the full functionality of the application. Search “uml diagram tool online” and pick the one you like to draw the UML.
b.Answers to item #4.