Question: help please eclipse 1. class course that includes three instance variables: private int ID; 11 course ID private String Name; // course name private Course

help please eclipse

help please eclipse 1. class course that includes three instance variables: privateint ID; 11 course ID private String Name; // course name privateCourse next; // link next Your class should have the following: Aconstructor that initializes the two instance variables id and name. Set andget methods for each instance variable. 2. class Department that includes two

1. class course that includes three instance variables: private int ID; 11 course ID private String Name; // course name private Course next; // link next Your class should have the following: A constructor that initializes the two instance variables id and name. Set and get methods for each instance variable. 2. class Department that includes two instance variables: private String deptName; private Course top; Your class should have the following: a constructor that initializes the department name public boolean exist(int id) that checks whether the course object with id passed as parameter exists in the stack or not. public boolean push(int id, String n) that creates and adds the course if the course with id passed as parameter does not exist in the stack. The course must be added to the top private void push (Course temp) that inserts a node given as a parameter into the stack. public Course pop () removes the top element from the stack if it exists and returns it to main; otherwise, return null. public String findCourse (int id) that returns a course name if the id exists in the stack. public void print() that prints the department name and all the courses in the stack. public void printReverse() that prints the department name and all the courses in the stack in reversed order. Write the expected time and space complexity as a comment at the beginning of each method of your class. 3. Write a test application named Lab4Test. 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- push a course 2- pop a course 3- search for a course 4- print stack 5- print stack 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). 2- pop a course 3 - search for a course 4- print course stack 5- print course stack in reverse 6- exit Please enter your selection: 5 Courses in Computer Engineering department are: 1 - 300 Design and Analysis of Algorithms 2 - 356 Computer Networks I 3 - 325 Human-Computer Interaction 4 - 262 Fundamentals of Digital Logic The program can perform the following: 1- push a course 2- pop a course 3- search for a course 4- print course stack 5- print course stack in reverse 6- exit Please enter your selection: 2 The course removed was 262 Fundamentals of Digital Logic The program can perform the following: 1- push a course 2- pop a course 3- search for a course 4- print course stack 5- print course stack in reverse 6- exit Please enter your selection: 4 Courses in Computer Engineering department are: 1 - 325 Human-Computer Interaction 2 - 356 Computer Networks I 3 - 300 Design and Analysis of Algorithms The program can perform the following: 1. push a course 2- pop a course 3- search for a course 4- print course stack 5. print course stack in reverse 6- exit Please enter your selection: 5 Courses in Computer Engineering department are: 1 - 300 Design and Analysis of Algorithms 2 - 356 Computer Networks I 3 - 325 Human-Computer Interaction The program can perform the following: 1. push a course 2- pop a course 3- search for a course 4- print course stack 5- print course stack in reverse 6- exit Please enter your selection: 3 Enter the course number: 262 The id: 262 does not correspond to any course in the department The program can perform the following: 1- push a course 2- pop a course 3- search for a course 4- print course stack 5- print course stack in reverse 6- exit Please enter your selection: 3 Enter the course number: 300 The id: 300 corresponds to Design and Analysis of Algorithms The program can perform the following: 1- push a course 2- pop a course 3- search for a course 4- print course stack 5- print course stack in reverse 6- exit Please enter your selection: 6 Exiting the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!