Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Student - ID: int - name: String - major: String + Student (ID: int, name: String, major: string) // setters getters + toString): Strin Employee

image text in transcribedimage text in transcribed

Student - ID: int - name: String - major: String + Student (ID: int, name: String, major: string) // setters getters + toString): Strin Employee name : String id: int Employee(name : String, id : int) // setters getters toString): Strin Registrar - students: LinkedList +Registrar () +addEmployee (employee: Employee) + removeEmployees): void + addStudent(student : Student): void + deletestudent(ID : int) : void + getAllComputerScience) : LinkedList + getAllMath0 : LinkedList + getAllBioInformatics() : LinkedList + hasStudent(name: String) : Boolean -register (name : String) : void + printStudents () : void You have to implement the previous three classes. The class Student has three private variables, a constructor, setters and getters, and a toString method. The class Employee has two private variables, a constructor, setters and getters, and a toString method. The class Registrar has a LinkedList of students, a linked list of employees, methods th LinkedLists at apply operations on the addEmployee( employee: Employee): Inserts the specific employee at the beginning of the list removeEmployees0: Removes all elements from employees list - addStudent (student : Student): takes a student as parameter and adds it to students - deleteStudent (ID: int): deletes a student from Students with the specified name getAllComputerScience 0: returns a LinkedList that contains all the students that have a major of computer science - getAllMath: returns LinkedList that contains all the students that have a major of Math - getAllBioInformatics O:returns LinkedList that contains all the students that have a major of Bioinformatics hasStudent(name : String): returns true if the student with the specified name is found in students; else, it returns false and calls register (name) - register(name : String): generates an ID, and adds the student to the students list and prints "registering student: "ID"+name - printStudents0: prints the students in students list In the tester class, you are required to create an object of type Registrar and add to its lists a number of students and employees. You should add each new employee to the beginning of the list. You should retrieve all students that are of computer science major and print them, retrieve all students that are of math major and print them, and retrieve all students that are of bioinformatics major and print them. You should test the deleteStudent method and print the students list after deletion Test the hasStudent method and verify that it is calling the register method if the student is not found in the list. Finally, remove all employees and hire new employees

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions