Question: Create an application called Registrar tiiat has the following classes: A Student class that minimally stores the following data fields for a student: name

Create an application called Registrar tiiat has the following classes:

A Student class that minimally stores the following data fields for a student:

■ name

■ student id number

■ number of credits

■ total grade points earned

The following methods should also be provided:

■ A constructor that initializes the name and id fields

■ A method that returns the student name field

A method that returns the student ID field

■ A method that determines if two student objects are equal if their student id numbers are the same (override equals from the class Object

■ Methods to set and retrieve the total number of credits

■ Methods to set and retrieve the total number of grade points earned

■ A method that returns the GPA (grade points divided by credits) students

An Instructor class that minimally stores the following data fields for an instructor:

■ name

■ faculty id number

■ department

The following methods should also be provided:

■ A constructor that initializes the name and id fields

■ Methods to set and retrieve the instructor’s department

A Course class that minimally stores the following data for a course:

■ name of the course

■ course registration code

■ maximum number of 35 students

■ instructor

■ number of students

■ students registered in the course (an array)

The following methods should also be provided:

■ A constructor that initializes the name, registration code, and maximum number of students

■ Methods to set and retrieve the instructor

■ A method to search for a student in the course; the search should be based on an ID number.

■ A method to add a student to the course. If the course is hill, then an exception with an appropriate message should be raised (try creating your own exception class for this). Also, be sure that the student is not already registered in the course. The list of students should be in the order that they registered.

■ A method to remove a student horn the course. If the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned above).

■ A method that will allow Course objects to be output to a file using object serialization

■ A method that will allow Course objects to be read in from a file created with Object serializtion

You will note that the Student and Instructor classes described above have some commonality. Create a Person class that captures this commonality and uses it as a base class for student and instructor. This class should be responsible for the name and id fields and also provide a toString method that returns a string of the form name, id. This will be the inherited toString method for the Student and Instructor classes.

a. Draw a UML diagram for diis application.

b. Implement the previous classes in Java. Write a main program diat can serve as a test class diat tests all of the methods created and demonstrates diat they are working.

Step by Step Solution

3.51 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To tackle this problem well follow these steps Step 1 Analyze and Understand the Requirements We need to design an application called Registrar with three main classes Student Instructor and Course Th... View full answer

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

Document Format (2 attachments)

PDF file Icon

606ad5686259d_48593.pdf

180 KBs PDF File

Word file Icon

606ad5686259d_48593.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!