Question: Objectives: Implementing a queue with links Using a linked queue to store objects Provided Files: QueueADT SinglyLinkedNode AnimalGUI Animal, Reptile, Mammal classes Lab Assignment :
Objectives:
Implementing a queue with links Using a linked queue to store objects
Provided Files:
QueueADT
SinglyLinkedNode
AnimalGUI
Animal, Reptile, Mammal classes
Lab Assignment :
In this lab, you are going to implement QueueADT interface that defines a queue. Then you are going to use the queue to store animals.
1. Write a LinkedQueue class that implements the QueueADT.java interface using links.
2. Textbook implementation uses a count variable to keep track of the elements in the queue. Don't use variable count in your implementation (points will be deducted if you use instance variable count). You may use a local integer variable to count number of nodes in method size.
3. Use the SinglyLinkedNode class to implement the queue with links.
4 Methods dequeue and first in your LinkedQueue class must throw an EmptyQueueException when queue is empty. You must write the EmptyQueueException class.
5.Use an application to create a queue of animals. Create mammal and reptile objects, store them in the queue, remove the animals, request first animal and display the queue. You can use the provided AnimalQueueAplicationFX1 application or you can create your own application. If you use the provided application, you will have to complete methods addMammal, addReptile, removeAnimal, firstAnimal and display. Use Try and catch in these methods where its required.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
