Question: Hello! I need help fixing the Java code I have so far to implement reserveAnimal() and printAnimals() methods. Thanks for the help :) Implement the

Hello! I need help fixing the Java code I have so far to implement reserveAnimal() and printAnimals() methods. Thanks for the help :)

  1. Implement the reserveAnimal() method. Your completed method should do the following:
    • Prompt the user for input. The user should enter their desired animal type and country.
    • If there is an available animal which meets the users input criteria, the method should access an animal object from an ArrayList. If there are multiple animals that meet these criteria, the program should access the first animal in the ArrayList. The method should also update the reserved attribute of the accessed animal.
    • If there is not an available animal which meets the users input criteria, the method should output feedback to the user letting them know that no animals of that type and location are available.
  2. Finally, you have been asked to implement a printAnimals() method that provides easy-to-read output displaying the details of objects in an ArrayList. Your implemented method must successfully print a list of all animals that are in service and available.

Grazioso Salvare Specification Document

Hello! I need help fixing the Java code I have so far

to implement reserveAnimal() and printAnimals() methods. Thanks for the help :) Implement

I've bolded the code I need help with and included contextual code!

Driver.java

Dog dog1 = new Dog("Spot", "German Shepherd", "male", "1", "25.6", "05-12-2019", "United States", "intake", false, "United States"); Dog dog2 = new Dog("Rex", "Great Dane", "male", "3", "35.2", "02-03-2020", "United States", "Phase I", false, "United States"); Dog dog3 = new Dog("Bella", "Chihuahua", "female", "4", "25.6", "12-12-2019", "Canada", "in service", true, "Canada");

Monkey monkey1 = new Monkey("Marcel", "Capuchin", "5.2", "9.4", "19.6", "male", "2", "15.3", "09-11-2019", "Canada", "Phase I", true, "Canada"); Monkey monkey2 = new Monkey("Kong", "Macaque", "4.8", "10.2", "20.7", "female", "1", "17.4", "12-05-2020", "United Kingdom", "in service", false, "United Kingdom"); Monkey monkey3 = new Monkey("Pat", "Tamarin", "5.5", "8.6", "18.4", "male", "3", "18.2", "12-10-2019", "United States", "intake", false, "United States");

// Complete reserveAnimal // You will need to find the animal by animal type and in service country public static void reserveAnimal(Scanner scanner) { System.out.println("The method reserveAnimal needs to be implemented"); } // Complete printAnimals // Include the animal name, status, acquisition country and if the animal is reserved. // Remember that this method connects to three different menu items. // The printAnimals() method has three different outputs // based on the listType parameter // dog - prints the list of dogs // monkey - prints the list of monkeys // available - prints a combined list of all animals that are // fully trained ("in service") but not reserved // Remember that you only have to fully implement ONE of these lists. // The other lists can have a print statement saying "This option needs to be implemented". // To score "exemplary" you must correctly implement the "available" list. public static void printAnimals() { System.out.println("The method printAnimals needs to be implemented"); }

GS GRAZIOSO SALVARE TRAINING RESCUE ANIMALS SINCE 1965 Grazioso Salvare Specification Document Overview Grazioso Salvare currently uses dogs as search and rescue animals. They expect to begin training monkeys as search and rescue animals as well. In current operations, dogs are given the status of "intake" before training starts. Once in training, their status can change to one of five phases: Phase 1, Phase II, Phase III, Phase IV, and Phase V. When a dog graduates from training, it is given the status of "in-service and is considered a Rescue Animal. If a dog does not successfully make it through training, it is given the status of "farm," indicating that it will live a life of leisure on a Grazioso Salvare farm. The Animals Currently when Grazioso Salvare acquires a dog, they record the name, breed, gender, age, and weight. Grazioso Salvare also records the date and the location where they acquired the dog. Additionally, they track the training status of the dog, as described above. When a dog is in- service, they record the country where the dog is in service and whether or not the dog is "reserved". Special Note on Monkeys As Grazioso Salvare explores the use of monkeys as search and rescue animals, they want their system to support monkey tracking as well as dog tracking. They have identified the following monkey species that are eligible for training: Capuchin Guenon Macaque Marmoset Squirrel monkey Tamarin There are important data elements for monkeys in addition to what they use for dogs. These include tail length, height, body length, and species. Functionality Work on this application has already been started. You must complete the following functionality: Create a Monkey Class that: o Inherits from the RescueAnimal class o Includes monkey-specific attributes Includes mutator and accessor methods for each attribute Complete the Driver Class. o Add a menu loop that: Displays the included) menu Prompts the user for input and validates the input Takes the appropriate action based on the input o Complete a method to intake a new dog that: Prompts the user for input and validates the input Sets data for all attributes Adds the newly instantiated dog to an ArrayList o Implement a method to intake a new monkey that: Prompts the user for input and validates based on monkey name and species type Sets data for all attributes Adds the newly instantiated monkey to an ArrayList o Implement a method to reserve an animal that: Prompts the user for input If animal matches input criteria: Accesses animal object from ArrayList and updates the 'reserved' attribute of the animal If no animal matches input criteria: Prints feedback to the user o Implement a method to print (display) information about the animals that: Prints a list of all dogs OR all monkeys OR all animals that are in service" and available (not reserved") GS GRAZIOSO SALVARE TRAINING RESCUE ANIMALS SINCE 1965 Grazioso Salvare Specification Document Overview Grazioso Salvare currently uses dogs as search and rescue animals. They expect to begin training monkeys as search and rescue animals as well. In current operations, dogs are given the status of "intake" before training starts. Once in training, their status can change to one of five phases: Phase 1, Phase II, Phase III, Phase IV, and Phase V. When a dog graduates from training, it is given the status of "in-service and is considered a Rescue Animal. If a dog does not successfully make it through training, it is given the status of "farm," indicating that it will live a life of leisure on a Grazioso Salvare farm. The Animals Currently when Grazioso Salvare acquires a dog, they record the name, breed, gender, age, and weight. Grazioso Salvare also records the date and the location where they acquired the dog. Additionally, they track the training status of the dog, as described above. When a dog is in- service, they record the country where the dog is in service and whether or not the dog is "reserved". Special Note on Monkeys As Grazioso Salvare explores the use of monkeys as search and rescue animals, they want their system to support monkey tracking as well as dog tracking. They have identified the following monkey species that are eligible for training: Capuchin Guenon Macaque Marmoset Squirrel monkey Tamarin There are important data elements for monkeys in addition to what they use for dogs. These include tail length, height, body length, and species. Functionality Work on this application has already been started. You must complete the following functionality: Create a Monkey Class that: o Inherits from the RescueAnimal class o Includes monkey-specific attributes Includes mutator and accessor methods for each attribute Complete the Driver Class. o Add a menu loop that: Displays the included) menu Prompts the user for input and validates the input Takes the appropriate action based on the input o Complete a method to intake a new dog that: Prompts the user for input and validates the input Sets data for all attributes Adds the newly instantiated dog to an ArrayList o Implement a method to intake a new monkey that: Prompts the user for input and validates based on monkey name and species type Sets data for all attributes Adds the newly instantiated monkey to an ArrayList o Implement a method to reserve an animal that: Prompts the user for input If animal matches input criteria: Accesses animal object from ArrayList and updates the 'reserved' attribute of the animal If no animal matches input criteria: Prints feedback to the user o Implement a method to print (display) information about the animals that: Prints a list of all dogs OR all monkeys OR all animals that are in service" and available (not reserved")

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!