Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please I want the code of class main in Java public class Course private String name; private int ID; private Course next, prev; public Course(String
please I want the code of class main in Java
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
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