In a university, a person would be a student or an employee. If it is an employee, he/she might be a staff member of a faculty. So we may have the following hierarchical and polymorphic relation.
Person
|
Staff |
Faculty |
Employee |
Student |
Each box above is representing a class. Each class will have some parameters and methods. Here I will list the parameters for each class but beside basic method, such as constructors and set/get methods, you need to add additional needed methods for each class. Here is the list of the parameters for each classes:
Person class:
1) First name
2) Last name
3) Date (for employee, it is a hiring day. For student, it is a starting day of college)
Person methods:
1) Constructors
2) Set/get methods
3) getSalary() //determines the salary of a person
4) toString() //converts a person in to a string
Student class:
1) List of grades grades
2) Status such as freshman, sophomore, junior or senior (1,2,3,4 )
3) e-mail address(firstName.lastName#@topper.wku.edu) Note: here # is indication student’s order number in the list. If student is the first one, then # is 1. If the student is the second in the list, then # is 2 etc.
Student methods
1) Constructors
2) Set/get methods
3) getSalary() //determines the salary of a person
4) toString() //converts a person in to a string
5) getGpa() // returns gpa of a student
Employee class:
1) Office (such as COHH4142)
2) e-mail address(firstName.lastName#@wku.edu) Note: here # is indication employee’s order number in the list. If employee is the first one, then # is 1. If the employee is the second in the list, then # is 2 etc.
Employee class:
1) Constructors
2) Set/get methods
3) getSalary() //determines the salary of a person
4) toString() //converts a person in to a string
Faculty class:
1) rank (assistant, associate, or full professor)
2) salary (double)
3) courses to teach (such as CS180, HIS120, etc)
Faculty methods:
1) Constructors
2) Set/get methods
3) getSalary() //determines the salary of a person
4) toString() //converts a person in to a string
Staff class:
1) tittle (such as AcademicAdvisor, Coach, Trainer, Clerk, etc)
2) hour(how many hour per week staff works)
3) wage(hourly wage)
Staff methods:
1) Constructors
2) Set/get methods
3) getSalary() //determines the salary of a person
4) toString() //converts a person in to a string
Staff salary needs to be computed weekly. If weekly hour is more than 40 hours, payment for extra hours are doubled.
If there is(are) other methods that needed please add them in appropriate classes.
In this project, you are going to write a java program to do the following:
1- Base on the information given in the input file, create an array of Person.
2- You will read Student, Faculty, and Staff information (not necessarily given in particular order) from a file and store them in to the array created in step 1.
3- Display the following:
Enter 1 to display all the persons sorted by last name in increasing order
Enter 2 to display student’s name with best gpa
Enter 3 to display employee that is hired earliest (the most senior employee).
Enter 4 to display highest paid employee
Enter 5 to ask for a last name, if such person exist in the array, display the info (if there are more than one, you may just display one of item)
Enter 6 to quit
Typical display of Student should be as follows:
Erik Brown
e-mail: Erik.Brown2@topper.wku.edu
Rank: 2
Date of Enrollment:01/08/1970
grades: 56 78 89 98 99
Current gpa: 84.00
Typical display of a faculty should be as follows:
Ferhan Atici
e-mail: Ferhan.Atici4@wku.edu
Office: COHH4107
Professor
Date of Hire:10/21/1970
Salary: 30000.00
Courses: MATH137 MATH387 MATH599
Typical display of a staff should be as follows:
Lynne Swetmon
e-mail: Lynne.Swetmon6@wku.edu
Office: COHH4023
Job: OfficeAssociate
Date of Hire: 03/04/1996
Salary: 1270.00(weekly)