Question
My assignment is about a University database using LinkedList (Java). First, I want to make two functions which are AddCollege and DeleteCollege. Here are the
My assignment is about a University database using LinkedList (Java). First, I want to make two functions which are AddCollege and DeleteCollege.
Here are the details:
\\
You should create two classes, one for College and the other for Department. A College should have at least the following parameters: (Please note that you may add additional parameters of your choice for each college if it helps you in any way)
College Name: string ( for example, Business, Engineering, etc.) Number of departments: int (this will be the number of department within a college) departments: Department (this field is of type Department reference/pointer which points to the object of type Department) next: College (this reference/pointer will point to the next college in the list)
You should provide functions to support the following operations:
1. Add a new college in the list (take input from user, all the fields and add a new college)
2. Delete a college from the list (based on colleges name). Notice that deleting a college should delete all the departments of that college as well.
The head should be called PMU.
\\
Please help me figure out those two functions first and tell me where do I define the head, too... like in which class? department class or college class?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started