Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Stacks and Queues Use arrays as underlying data structures to implement a stack, a queue and a priority queue for Student objects. The Student class
Stacks and Queues Use arrays as underlying data structures to implement a stack, a queue and a priority queue for Student objects. The Student class should contain a name field of the String type, an id field of the String type, and a GPA field of a double type. The priority queue should be based on the id number. Write a demo program to show how your ADTs work. 1. An airport has only one runway. When it is busy, planes wishing to take off or land have to wait. Implement a simulation, using queues, one each for the planes waiting to take off and land Landing planes get priority. The user uses methods such as takeoff (flightSymbol), land (flightsymbol), and next(). The first two methods place the flight in the queue. The next() 2. 6, enables the next one, and prints the action (takeoff or land) and the flight symbol Write a generic Stack class and a generic Queue class so that either Cat objects or Dog objects are permitted to be stored in them. They should be stored separately, not at the same time in the same stack nor the same queue. The Dog and Cat classes will have the following instance variables: name, breed, weight, and age. Write a demo class to try to use the stack and queue to store a bunch of cats and a bunch of dogs 3. Write a JavaFX GUI application that will show a list of Student names in a ComboBox on the left These students will then be added into a stack or a queue based on which button (StackBtn or queueBtn) is clicked. As each student gets added, his/her name should be removed from the comboBox. After all the students are added, the user will click another button called "Show", which will display the name, ID, gpa, and major popped out from the stack and removed from the queue in two separate text areas 4. Stacks and Queues Use arrays as underlying data structures to implement a stack, a queue and a priority queue for Student objects. The Student class should contain a name field of the String type, an id field of the String type, and a GPA field of a double type. The priority queue should be based on the id number. Write a demo program to show how your ADTs work. 1. An airport has only one runway. When it is busy, planes wishing to take off or land have to wait. Implement a simulation, using queues, one each for the planes waiting to take off and land Landing planes get priority. The user uses methods such as takeoff (flightSymbol), land (flightsymbol), and next(). The first two methods place the flight in the queue. The next() 2. 6, enables the next one, and prints the action (takeoff or land) and the flight symbol Write a generic Stack class and a generic Queue class so that either Cat objects or Dog objects are permitted to be stored in them. They should be stored separately, not at the same time in the same stack nor the same queue. The Dog and Cat classes will have the following instance variables: name, breed, weight, and age. Write a demo class to try to use the stack and queue to store a bunch of cats and a bunch of dogs 3. Write a JavaFX GUI application that will show a list of Student names in a ComboBox on the left These students will then be added into a stack or a queue based on which button (StackBtn or queueBtn) is clicked. As each student gets added, his/her name should be removed from the comboBox. After all the students are added, the user will click another button called "Show", which will display the name, ID, gpa, and major popped out from the stack and removed from the queue in two separate text areas 4
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