Adopt-A-Pet java programming challenge

Online tutoring services

Need help with this question or any other Java Programming assignment help task? Click on the button below to to hire an expert cheap.

Use the LinkedList class to simulate a queue, and use the add method to simulate the enqueue, and the remove method to simulate the dequeue method for a Queue. Remember to use FIFO. Use the LinkedList class to simulate a queue, and use the add method to simulate the enqueue, and the remove method to simulate the dequeue method for a Queue. Remember to use FIFO. Create 3 queues, one called Animal Shelter, another called Cats, and another called Dogs. Use the following menu-driven application: 1. Adopt a Cat 2. Adopt a Dog 3. Adopt Oldest Pet 4. Donate a Cat 5. Donate a Dog 6. Add New Microchips 7. Exit Create a Pet class that will be instantiated with the values in the following attributes: String name, int dateOfBirth //yyyymmdd format, String species, Long microchipNumber. Note: The Dog queue and Cat queue are "regular" queues, and the Animal Shelter queue is a Priority Queue, where the priority is based upon the dateOfBirth of the pet. The older the pet, the higher its priority. See the attached .zip file for examples of a PriorityQueue. Each week, on Monday before the Animal Shelter opens, an administrator of the Animal Shelter adds more microchips to the stack of microchips, so that there will be enough microchips to put in any animal that is donated into the shelter that week. To simulate this, you will create a menu option, which will generate 100 microchip long objects, and place them into a stack of microchips. Those microchip objects will be generated by using the System.nanotime() method. Each time a person donates a cat or dog, ask for the name of the pet, the species, and the date of birth, and pop the microchip stack to get a chip to put in the pet. Create a new Pet object. Then, add the Pet object to both its specific species queue, and the general Animal Shelter queue. If the stack of microchips is empty, give an error message to the user, stating the pet cannot be donated because there are no microchips left. Ask the user to press option 6 to get more microchips. When a person selects to adopt a specific species pet, remove the first pet object from the appropriate species queue, and also from the Animal Shelter queue. Take care to find the pet in the Animal Shelter queue, and remove it. (hint: To find the dog or cat in the Animal Shelter that matches the one you just adopted from the dog or cat queue, you may need to EITHER establish an iterator on the Animal Shelter queue to search for the Pet, or without an iterator remove all animals and put them in a new queue except for the dog or cat that matches. Once the new queue is created, point the old queue to the new queue.) When a person comes in to adopt the oldest pet in the shelter, then process the Animal Shelter as a PriorityQueue, where the pet's date of birth is the attribute used to retrieve the oldest pet (hint: Pet class should implement Comparable, and should define a compareTo method that would sort in ascending date-of-birth order. ) So, when you dequeue the Animal Shelter as a Priority Queue, you will automatically get the Pet with the earliest/oldest date of birth first . Then, after removing the oldest pet object from the animal shelter, then dequeue it from the appropriate species queue (will have to do a sequential search in the the appropriate queue, according to the Pet object's species attribute. See hint above for keeping the exact order in the queue). -----------------------------

Get Help With a similar task to - Adopt-A-Pet java programming challenge

Login to view and/or buy answers.. or post an answer

Related Questions

Similar orders to Adopt-A-Pet java programming challenge
4
Views
0
Answers
Finding pixel of an image in java programming
This is the coding assignment I have, I need it done in 12 hours. I can only pay 60$ since I am a first year student, would it possible for this to be done?...
6
Views
0
Answers
Creating a website , Jacascript.
I have a JavaScript group project, me and my group are creating a website on the professional team “PSG” & I am in charge of doing the Gallery HTML page which is the page that is where the pictures of the soccer team will be placed . It is due on Sunday 11:59 pm est....
43
Views
0
Answers
Javascript program that creates a tree, makes it age, grow, bear fruit, and eventually die
Make a file named program5_1.js. In this file, make an OrangeTree class that has a height method that returns its height and a oneYearPasses method that, when called, ages the tree one year. Each year the tree grows taller (however much you think an orange tree should grow in a year), and after some number of years (when the years entered by the user passes), the tree should die. For the first few years, it should not produce fruit, but after awhile it should, and I guess that older trees produce more each year than younger trees..whatever you think makes the mose sense. And, of course, you should have the following methods, countOranges(which returns the number of oranges on the tree) and a pickAnOrange(which reduces the orange count by 1 and returns a string telling you how delicious the orange was, or else it just tells you that there are no ore oranges to pick this year). When I run the program, it should ask me how many years the tree should grow. Create an instance of the tree and run a loop growing it for each year passed. Each year, the program should prompt the user to eiher pick an orange. If the user says yes, call the pickAnOrange method on the tree. When the years chos...
17
Views
0
Answers
na...................................................................
na...................................................................na...................................................................na...................................................................na...................................................................na...................................................................na...................................................................na...................................................................na...................................................................na...................................................................na......................................................................