Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Public static void showPets(){   Display a message that this is the Animal Shelter Priority Queue, in order of birth date

Public static void showPets(){   Display a message that this is the Animal Shelter Priority Queue, in order of birth date

Computer Science

Public static void showPets(){

 

  • Display a message that this is the Animal Shelter Priority Queue, in order of birth date. Then, make a loop that will display all the Pets in the Animal Shelter, a Priority Queue based upon the birth date of the Pet. You MUST use a loop to show the pets in the correct order (ascending by birth date).
  • Make a new PQ Animal Shelter; Loop to poll the Animal Shelter, print it,  & add to new PQ Animal Shelter. At the end of the loop, make the Original Animal Shelter PQ point to the new one. Then, display a message that states this is the Cat LinkedList, and then display the LinkedList for Cats, which is in the order of arrival to animal shelter.
  • Make an iterator for the Cat LinkedList. Use a while-loop testing it.hasNext(), jumping over each node with a next().  Print each node.
  • Finally, display a message that states this is the Dog List, and then display the LinkedList for Dogs, which is in the order of arrival to animal shelter.

       }

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE