Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java: I did class Course & class Department not sure if they are correct and I need the main class with (do while loop) &

java: I did class Course & class Department not sure if they are correct
and I need the main class with (do while loop) & (switch) for the menu
Thank you.
image text in transcribed
image text in transcribed
image text in transcribed
public class Course private String name; private int ID; private Course next, prev; public Course(String name, int ID) super(); name = name; ID = ID; public String getName() return name; public void setName(String name) name = name; public int getIDO) return ID; public void setID(int ID) ID = ID; @Override public String tostring({ return public Course getNext() { return next; public void setNext(Course next) { this.next = next; public Course getPrev() { return prev; public void setPrev(Course prev) { this.prev = prev; public class Department private String deptName, private Course head, tail public Department String deptNamel this.deptName deptName: public boolean existint id for Course inheadit nu ingetNet getooid return true; return false public void prie for Course le head; null, ll getNext System.out.printin public void printReversek for Course italienurlaget PrevOK System.out.printl public boolean insertinti, String ni Fleistid) return false; Course Ter Coursein, id: empty if head head-taile: else if id chead getIDOK head.setPrev(); head-T: else if id tailgetin T.setPrevital Por course inheadit nullinge WidgetNext.get T.setNetliget getNext setPrevi); setNext) T.setPrevio: break public boolean removeinti i existdio return false; if head to) head-head getNet else if tailgetitusid tai tail.getPrev: else { for Course inhead;itenultinget ideelgetak gePrev setNext.getNext getest.setPrevige Prev: return true 3. Write a test application named Lab3Test. In the main method, do the following: Input the department name then create a department object. Display a menu to the user and asking for a choice to be entered. As follows: The program can perform the following: 1- insert a course 2- remove a course 3- search for a course 4- print courses 5- print courses in reverse 6- exit Please enter your selection: The program will perform the action selected by the user and display a proper message when necessary. The program will repeat these actions until the user terminates the program (Hint: Use a loop)

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Distinguish between recruitment sources and recruitment methods.

Answered: 1 week ago

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago

Question

=+ 2. What is the opportunity cost of seeing a movie?

Answered: 1 week ago