UniversityDriver Class

The UniversityDriver contains the main method. Your program must run according to the sample run examples provided below.

The following commands can be entered:

(a) "hire" //to hire a new faculty member
(b) "admit" //to admit a new student
(c) "find student" //to display information about a specific student: name, date of
birth, and major
(d)"find faculty" //display information about a specific faculty: name, date of birth,
and courses;
(e) "list students" // list the first and last names of all students
(f) "list faculty" // list the first and last names of all faculty
(g)"quit"// terminates the program and saves all Person data in a
"UniversityPersons.per" file, including the ones hired and admitted by the user

University Class

The University class must have the following variables:

String universityName; //displayed at the start of the program
String motto; //displayed at the start of the program
Person [] people; //contains all Student objects and Faculty objects for the
university.
String [] majors; //contains all majors offered at this university
String [] courses; //contains all courses offered at this university

The University class must have a constructor that takes two String parameters. The first is the university name and the second is the university motto.

Your program must load all available majors and courses for the university through the University Constructor. The available majors and courses are listed below.

Available Majors:

Hardware Architecture
Information Analytics
Quantum Computing
Undecided

Available Courses:

Computers
Advance Physics
Quantum Entanglement
Parallel Programming
Advance Algorithms
FPGA Programming
Hardware Design
Embedded Systems
Signal Processing
Artificial Intelligence
Bayesian Logic
Probability

Your University constructor must also load the initial university data provided below if a "UniversityPersons.per" file is not available. If a UniversityPersons.per is available, it loads all Persons saved from the previous run instead of the initial university data.

The University class must also implement the School interface provided below.

public interface School {
//returns the Student specified by fn(firstName) and ln (lastName)
Student findStudent(String fn, String ln);
//returns the Student specified by fn(firstName) and ln (lastName)
Faculty findFaculty(String fn, String ln);
//adds a Faculty object to the Person []
Faculty hire(Person p);
//adds a Student object to the Person []
Student admit(Person p);
//returns the people variable for the university
Person [] getAllPersons();
//returns the majors variable for the university
String [] getAllMajors();
//returns the courses variable for the university
String [] getAllCourses();
//returns a Person [] of all Students only
Person [] getStudents();
//returns a Person [] of all Faculty only
Person [] getFaculty();
}

Person Class

The Person class must have the following variables:

String firstName; //first Name
String lastName; //last Name
int monthBirth;//month of date of birth
int dayBirth; //day of date of birth
int yearBirth; //year of date of birth

The Person class must also have a constructor.

Student Class

The Student class extends Person and must have a String major (the student's major) variable and a constructor.

Faculty Class

The Faculty class extends Person and must have a String [] courses (courses the faculty member teaches) variable and a constructor.

Initial University Data:

Faculty: (first name, last name, month-birth, day-birth, year-birth, course 1, course 2, course n )

"Bruce", "Wayne", 9, 27, 1995, "Bayesian Logic", "Artificial Intelligence", "Hardware Design"
"Diana","Prince", 11, 5, 2006, "Hardware Design", "FPGA Programming", "Embedded Systems"
"Barbara", "Gordon", 5, 23, 1980, "Probability", "Signal Processing", "Advance Algorithms"
"Charles","Xavier", 11, 5, 1966, "Signal Processing", "Embedded Systems", "Parallel Programming"

Students: (first name, last name, month-birth, day-birth, year-birth, major)

"Billy", "Baston", 7, 12, 1990, "Information Analytics"
"Carol", "Danvers", 4, 9, 1992, "Quantum Computing"
"Clark", "Kent", 5, 5, 1994 , "Hardware Architecture"
"Kara", "Zorel", 4, 13, 1989, "Hardware Architecture"
"Peter","Parker", 6, 25, 1997, "Quantum Computing"
"Tony","Stark", 2, 2, 2004, "Hardware Architecture"
"Stephen","Strange", 12, 15, 1976, "Quantum Computing"
"Bruce","Banner", 9, 9, 2000, "Undecided"

Sample Runs:

Run 1: a "UniversityPersons.per" file is not available

Welcome To HERO UNIVERSITY
ex tenebris ad lucem alis novis volabimus

What would you like to do?
Enter "hire" to hire a new faculty member.
Enter "admit" to admit a new student.
Enter "find student" to list information about a student.
Enter "find faculty" to list information about a faculty member.
Enter "list students" to list the names of all students.
Enter "list faculty" to list the names of faculty members.
Enter "quit" to end this program and save data.

>list students

Billy Baston
Carol Danvers
Clark Kent
Kara Zorel
Peter Parker
Tony Stark
Stephen Strange
Bruce Banner

>list faculty

Bruce Wayne
Diana Prince
Barbara Gordon
Charles Xavier

>find student
What is the student's first name?
>Tony
What is the student's last name?
>Stark

Student: Tony Stark
DOB: 2/2/2004
Major: Hardware Architecture

>find student
What is the student's first name?
>Bruce
What is the student's last name?
>Wayne
Student not found
>find faculty
What is the faculty's first name?
>Bruce
What is the faculty's last name?
>Wayne

Faculty: Bruce Wayne
DOB: 9/27/1995
Courses:
Bayesian Logic
Artificial Intelligence
Hardware Design

>find student
What is the student's first name?
>Nathan
What is the student's last name?
>Summers
Student not found
>admit
What is this person's major?

The majors offered are:
Hardware Architecture
Information Analytics
Quantum Computing
Undecided

> European History
That is not a major offered.
What is this person's major?
>Undecided
What is the person's first name?
>Nathan
What is the person's last name?
>Summers
What is the person's month of birth?
Enter an integer representing the month of birth
>7
What is the person's day of birth?
Enter an integer representing the day of birth
>15
What is the person's year of birth?
Enter an integer representing the year of birth (4 digits)
>1995
>find student
What is the student's first name?
>Nathan
What is the student's last name?
>Summers

Student: Nathan Summers
DOB: 7/15/1995
Major: Undecided

>hire
What is the person's first name?
>Victor
What is the person's last name?
>Von Doom
What is the person's month of birth?
>3
What is the person's day of birth?
>17
>What is the person's year of birth?
>1982
>Assign a course to this Faculty
Enter "done" if there are no other courses.

The courses offered are:

Computers
Advance Physics
Quantum Entanglement
Parallel Programming
Advance Algorithms
FPGA Programming
Hardware Design
Embedded Systems
Signal Processing
Artificial Intelligence
Bayesian Logic
Probability

>Advanced Physics
Assign a course to this Faculty
Enter "done" if there are no other courses.
> Artificial Intelligence
Assign a course to this Faculty
Enter "done" if there are no other courses.
>FPGA Programming
Assign a course to this Faculty
Enter "done" if there are no other courses.
>Art History
That is not a course offered.
Assign a course to this Faculty
Enter "done" if there are no other courses.
>done
>find faculty
What is the faculty's first name?
>Victor
What is the faculty's last name?
>Von Doom

Faculty: Victor Von Doom
DOB: 3/17/1982
Courses:
Advanced Physics
Artificial Intelligence
FPGA Programming
>quit

Run 2: run immediately after Run 1

Welcome To HERO UNIVERSITY
ex tenebris ad lucem alis novis volabimus

What would you like to do?
Enter "hire" to hire a new faculty member.
Enter "admit" to admit a new student.
Enter "find student" to list information about a student.
Enter "find faculty" to list information about a faculty member.
Enter "list students" to list the names of all students.
Enter "list faculty" to list the names of faculty members.
Enter "quit" to end this program and save data.

>list students

Billy Baston
Carol Danvers
Clark Kent
Kara Zorel
Peter Parker
Tony Stark
Stephen Strange
Bruce Banner
Nathan Summers

>list Faculty

Bruce Wayne
Diana Prince
Barbara Gordon
Charles Xavier
Victor Von Doom

>quit
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.