Question: THESE CODES IS WHAT IS INSIDE THE FILE Grazioso.zip (Eclipse Project File) import java.util.ArrayList; import java.util.Scanner; public class Driver { private static ArrayList dogList =



![main(String[] args) { initializeDogList(); initializeMonkeyList(); // Add a loop that displays the](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f9383774d84_88666f93836ebf3d.jpg)






![System.out.println("\t\t\t\tRescue Animal System Menu"); System.out.println("[1] Intake a new dog"); System.out.println("[2] Intake a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f9383c02fca_89166f9383b98e4c.jpg)
THESE CODES IS WHAT IS INSIDE THE FILE Grazioso.zip (Eclipse Project File)
import java.util.ArrayList;
import java.util.Scanner;
public class Driver {
private static ArrayList dogList = new ArrayList();
// Instance variables (if needed)
public static void main(String[] args) {
initializeDogList();
initializeMonkeyList();
// Add a loop that displays the menu, accepts the users input
// and takes the appropriate action.
// For the project submission you must also include input validation
// and appropriate feedback to the user.
// Hint: create a Scanner and pass it to the necessary
// methods
// Hint: Menu options 4, 5, and 6 should all connect to the printAnimals() method.
}
// This method prints the menu options
public static void displayMenu() {
System.out.println(" ");
System.out.println("\t\t\t\tRescue Animal System Menu");
System.out.println("[1] Intake a new dog");
System.out.println("[2] Intake a new monkey");
System.out.println("[3] Reserve an animal");
System.out.println("[4] Print a list of all dogs");
System.out.println("[5] Print a list of all monkeys");
System.out.println("[6] Print a list of all animals that are not reserved");
System.out.println("[q] Quit application");
System.out.println();
System.out.println("Enter a menu selection");
}
// Adds dogs to a list for testing
public static void initializeDogList() {
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");
dogList.add(dog1);
dogList.add(dog2);
dogList.add(dog3);
}
// Adds monkeys to a list for testing
//Optional for testing
public static void initializeMonkeyList() {
}
// Complete the intakeNewDog method
// The input validation to check that the dog is not already in the list
// is done for you
public static void intakeNewDog(Scanner scanner) {
System.out.println("What is the dog's name?");
String name = scanner.nextLine();
for(Dog dog: dogList) {
if(dog.getName().equalsIgnoreCase(name)) {
System.out.println(" This dog is already in our system ");
return; //returns to menu
}
}
// Add the code to instantiate a new dog and add it to the appropriate list
}
// Complete intakeNewMonkey
//Instantiate and add the new monkey to the appropriate list
// For the project submission you must also validate the input
// to make sure the monkey doesn't already exist and the species type is allowed
public static void intakeNewMonkey(Scanner scanner) {
System.out.println("The method intakeNewMonkey needs to be implemented");
}
// 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");
}
}
import java.lang.String;
public class RescueAnimal {
// Instance variables
private String name;
private String animalType;
private String gender;
private String age;
private String weight;
private String acquisitionDate;
private String acquisitionCountry;
private String trainingStatus;
private boolean reserved;
private String inServiceCountry;
// Constructor
public RescueAnimal() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAnimalType() {
return animalType;
}
public void setAnimalType(String animalType) {
this.animalType = animalType;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
public String getAcquisitionDate() {
return acquisitionDate;
}
public void setAcquisitionDate(String acquisitionDate) {
this.acquisitionDate = acquisitionDate;
}
public String getAcquisitionLocation() {
return acquisitionCountry;
}
public void setAcquisitionLocation(String acquisitionCountry) {
this.acquisitionCountry = acquisitionCountry;
}
public boolean getReserved() {
return reserved;
}
public void setReserved(boolean reserved) {
this.reserved = reserved;
}
public String getInServiceLocation() {
return inServiceCountry;
}
public void setInServiceCountry(String inServiceCountry) {
this.inServiceCountry = inServiceCountry;
}
public String getTrainingStatus() {
return trainingStatus;
}
public void setTrainingStatus(String trainingStatus) {
this.trainingStatus = trainingStatus;
}
}
PLEASE ADD COMMENTS FOR BETTER UNDERSTANDING
Directions
Your team lead has given you a specification document detailing Grazioso Salvares software needs. Other members of the Global Rain development team have already started creating the RescueAnimal.java, Dog.java, and Driver.java class files. Your team lead has asked you to modify the existing Driver.java class and create a Monkey.java class as your contribution to the team.
- Dog.java Class File: You were not required to make changes to this file
public class Dog extends RescueAnimal {
// Instance variable private String breed;
// Constructor public Dog(String name, String breed, String gender, String age, String weight, String acquisitionDate, String acquisitionCountry, String trainingStatus, boolean reserved, String inServiceCountry) { setName(name); setBreed(breed); setGender(gender); setAge(age); setWeight(weight); setAcquisitionDate(acquisitionDate); setAcquisitionLocation(acquisitionCountry); setTrainingStatus(trainingStatus); setReserved(reserved); setInServiceCountry(inServiceCountry);
}
// Accessor Method public String getBreed() { return breed; }
// Mutator Method public void setBreed(String dogBreed) { breed = dogBreed; }
}
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 I, 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 inservice, 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:
Inherits from the RescueAnimal class
Includes monkey-specific attributes
Includes mutator and accessor methods for each attribute
Complete the Driver Class.
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
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
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
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
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)
Note: There are comments throughout the code to guide you. There is also a method that adds
some data to a dog array list so that you will have data for testing. You can add a similar method
for monkeys if you like.
Directions Monkey.java Class Your team lead reminded you to demonstrate industry standard best practices in all of your code to ensure clarity, consistency, and efficiency among all software developers working on the program. In your code for each class, be sure to include the following: In-line comments that denote your changes and briefly describe the functionality of each method or element of the class Appropriate variable and method naming conventions In a new Java file, create the Monkey class, using the specification document as a guide. The Monkey class must do the following: Inherit from the Rescue Animal class Implement all attributes to meet the specifications Include a constructor. You may use a default constructor. To score "exemplary" on this criterion, you must include the more detailed constructor that initializes values for all attributes. Refer to the constructor in the Dog class for an example. Include accessors and mutators for all implemented attributes Driver.java Class In this class, you will modify and implement several different methods. You will need to refer back to the code from the other classes to properly implement these methods. As a reminder, you must demonstrate industry standard best practices, such as in-line comments to denote changes and describe functionality and appropriate naming conventions throughout the code that you create or modify for this class. First, you will modify the main() method. In main(), you must create a menu loop that does the following: Displays the menu by calling the displayMenu() method. This method is in the Driver.java class. Prompts the user for input Includes input validation. If the user inputs a value not on the menu, the program should print an error message. Takes the appropriate action based on the value that the user entered. LG Page view Read aloud Draw IMPORTANT: In the Module Five milestone, you were asked to create a menu loop but were not required to include input validation. Be sure to include input validation for your Project Two submission. Next, you will complete the intakeNewDog() method. Your completed method should do the following: Prompt the user for input Include input validation. Note: The required input validation has already been included in the starter code; be sure to review it. Set data for all attributes based on user input Add the newly instantiated dog to an ArrayList Hint: Remember to refer to the accessors and mutators in the Dog and Rescue Animal classes as you create this method. Next, you will implement the intakeNewMonkey() method. Before you do this, you will need to create a monkey ArrayList in the Driver.java class. Refer to the dog ArrayList for an example. Then, begin implementing the intakeNewMonkey() method. Your completed method should do the following: Prompt the user for input Include input validation for the monkey's name and species type. If the user enters an invalid option, the program should print an error message. Set data for all attributes based on user input Add the newly instantiated monkey to an ArrayList Hint: Remember to refer to the accessors and mutators in your Monkey and RescueAnimal classes as you create this method. IMPORTANT: In the Module Five milestone, you began implementing this method but were not required to include input validation. Be sure to include input validation for your Project Two submission. Next, you will 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 user's 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 user's input criteria, the method should output feedback to the user letting them know that no animals of that type and location are available. Finally, you have been asked to implement a printAnimals() method that provides easy-to-read output displaying the details of objects in an ArrayList. To demonstrate this criterion in a "proficient" way, your implemented method must successfully print the ArrayList of dogs or the ArrayList of monkeys. To demonstrate this criterion in an "exemplary" way, your implemented method must successfully print a list of all animals that are "in service" and "available" Supporting Materials THESE CODES IS WHAT IS INSIDE THE FILE Grazioso.zip (Eclipse Project File) import java.util.ArrayList; import java.util.Scanner; public class Driver { private static ArrayList dogList = new ArrayList(); // Instance variables (if needed) public static void main(String[] args) { initializeDogList(); initializeMonkeyList(); // Add a loop that displays the menu, accepts the users input // and takes the appropriate action. // For the project submission you must also include input validation // and appropriate feedback to the user. // Hint: create a Scanner and pass it to the necessary // methods age view Draw // Hint: Menu options 4, 5, and 6 should all connect to the printAnimals() method. } // This method prints the menu options public static void displayMenu() { System.out.println(" "); System.out.println("\t\t\t\tRescue Animal System Menu"); System.out.println("[1] Intake a new dog"); System.out.println("[2] Intake a new monkey"); System.out.println("[3] Reserve an animal"); System.out.println("[4] Print a list of all dogs"); System.out.println("[5] Print a list of all monkeys"); System.out.println("[6] Print a list of all animals that are not reserved"); System.out.println("[q] Quit application"); System.out.println(); System.out.println("Enter a menu selection"); } // Adds dogs to a list for testing public static void initializeDogList() { 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"); dogList.add(dog1); dogList.add(dog2); dogList.add(dog3); } // Adds monkeys to a list for testing //Optional for testing public static void initializeMonkeyList() { } // Complete the intakeNewDog method // The input validation to check that the dog is not already in the list // is done for you public static void intakeNewDog(Scanner scanner) { System.out.println("What is the dog's name?"); String name = scanner.nextLine(); for(Dog dog: dogList) { if(dog.getName().equalsignoreCase(name)) { System.out.println(" This dog is already in our system "); return; //returns to menu } } // Add the code to instantiate a new dog and add it to the appropriate list // Complete intakeNewMonkey 1/Instantiate and add the new monkey to the appropriate list // For the project submission you must also validate the input // to make sure the monkey doesn't already exist and the species type is allowed public static void intakeNewMonkey(Scanner scanner) { System.out.println("The method intakeNewMonkey needs to be implemented"); } // 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 reserve Animal 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"); } } import java.lang.String; public class RescueAnimal { // Instance variables private String name; private String animalType; private String gender; private String age; private String weight; private String acquisitionDate; private String acquisitionCountry; private String trainingStatus; private boolean reserved; private String in ServiceCountry; // Constructor public RescueAnimal() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAnimalType() { return animalType; } public void setAnimalType(String animalType) { this.animalType = animalType; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } public String getWeight() { return weight; } public void setWeight(String weight) { this.weight = weight; } public String getAcquisitionDate() { return acquisitionDate; } public void setAcquisitionDate(String acquisitionDate) { this.acquisition Date = acquisition Date; } public String getAcquisitionLocation() { return acquisitionCountry; } page view Read aloud Draw public void setAcquisition Location(String acquisitionCountry) { this.acquisition Country = acquisitionCountry; } public boolean getReserved() { return reserved; } public void setReserved(boolean reserved) { this.reserved = reserved; } public String getinService Location() { return in ServiceCountry; } public void setinServiceCountry(String in ServiceCountry) { this.inServiceCountry = in ServiceCountry; } public String getTrainingStatus() { return trainingStatus; } public void setTrainingStatus(String trainingStatus) { this.trainingStatus = trainingStatus; } } PLEASE ADD COMMENTS FOR BETTER UNDERSTANDING Directions Monkey.java Class Your team lead reminded you to demonstrate industry standard best practices in all of your code to ensure clarity, consistency, and efficiency among all software developers working on the program. In your code for each class, be sure to include the following: In-line comments that denote your changes and briefly describe the functionality of each method or element of the class Appropriate variable and method naming conventions In a new Java file, create the Monkey class, using the specification document as a guide. The Monkey class must do the following: Inherit from the Rescue Animal class Implement all attributes to meet the specifications Include a constructor. You may use a default constructor. To score "exemplary" on this criterion, you must include the more detailed constructor that initializes values for all attributes. Refer to the constructor in the Dog class for an example. Include accessors and mutators for all implemented attributes Driver.java Class In this class, you will modify and implement several different methods. You will need to refer back to the code from the other classes to properly implement these methods. As a reminder, you must demonstrate industry standard best practices, such as in-line comments to denote changes and describe functionality and appropriate naming conventions throughout the code that you create or modify for this class. First, you will modify the main() method. In main(), you must create a menu loop that does the following: Displays the menu by calling the displayMenu() method. This method is in the Driver.java class. Prompts the user for input Includes input validation. If the user inputs a value not on the menu, the program should print an error message. Takes the appropriate action based on the value that the user entered. LG Page view Read aloud Draw IMPORTANT: In the Module Five milestone, you were asked to create a menu loop but were not required to include input validation. Be sure to include input validation for your Project Two submission. Next, you will complete the intakeNewDog() method. Your completed method should do the following: Prompt the user for input Include input validation. Note: The required input validation has already been included in the starter code; be sure to review it. Set data for all attributes based on user input Add the newly instantiated dog to an ArrayList Hint: Remember to refer to the accessors and mutators in the Dog and Rescue Animal classes as you create this method. Next, you will implement the intakeNewMonkey() method. Before you do this, you will need to create a monkey ArrayList in the Driver.java class. Refer to the dog ArrayList for an example. Then, begin implementing the intakeNewMonkey() method. Your completed method should do the following: Prompt the user for input Include input validation for the monkey's name and species type. If the user enters an invalid option, the program should print an error message. Set data for all attributes based on user input Add the newly instantiated monkey to an ArrayList Hint: Remember to refer to the accessors and mutators in your Monkey and RescueAnimal classes as you create this method. IMPORTANT: In the Module Five milestone, you began implementing this method but were not required to include input validation. Be sure to include input validation for your Project Two submission. Next, you will 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 user's 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 user's input criteria, the method should output feedback to the user letting them know that no animals of that type and location are available. Finally, you have been asked to implement a printAnimals() method that provides easy-to-read output displaying the details of objects in an ArrayList. To demonstrate this criterion in a "proficient" way, your implemented method must successfully print the ArrayList of dogs or the ArrayList of monkeys. To demonstrate this criterion in an "exemplary" way, your implemented method must successfully print a list of all animals that are "in service" and "available" Supporting Materials THESE CODES IS WHAT IS INSIDE THE FILE Grazioso.zip (Eclipse Project File) import java.util.ArrayList; import java.util.Scanner; public class Driver { private static ArrayList dogList = new ArrayList(); // Instance variables (if needed) public static void main(String[] args) { initializeDogList(); initializeMonkeyList(); // Add a loop that displays the menu, accepts the users input // and takes the appropriate action. // For the project submission you must also include input validation // and appropriate feedback to the user. // Hint: create a Scanner and pass it to the necessary // methods age view Draw // Hint: Menu options 4, 5, and 6 should all connect to the printAnimals() method. } // This method prints the menu options public static void displayMenu() { System.out.println(" "); System.out.println("\t\t\t\tRescue Animal System Menu"); System.out.println("[1] Intake a new dog"); System.out.println("[2] Intake a new monkey"); System.out.println("[3] Reserve an animal"); System.out.println("[4] Print a list of all dogs"); System.out.println("[5] Print a list of all monkeys"); System.out.println("[6] Print a list of all animals that are not reserved"); System.out.println("[q] Quit application"); System.out.println(); System.out.println("Enter a menu selection"); } // Adds dogs to a list for testing public static void initializeDogList() { 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"); dogList.add(dog1); dogList.add(dog2); dogList.add(dog3); } // Adds monkeys to a list for testing //Optional for testing public static void initializeMonkeyList() { } // Complete the intakeNewDog method // The input validation to check that the dog is not already in the list // is done for you public static void intakeNewDog(Scanner scanner) { System.out.println("What is the dog's name?"); String name = scanner.nextLine(); for(Dog dog: dogList) { if(dog.getName().equalsignoreCase(name)) { System.out.println(" This dog is already in our system "); return; //returns to menu } } // Add the code to instantiate a new dog and add it to the appropriate list // Complete intakeNewMonkey 1/Instantiate and add the new monkey to the appropriate list // For the project submission you must also validate the input // to make sure the monkey doesn't already exist and the species type is allowed public static void intakeNewMonkey(Scanner scanner) { System.out.println("The method intakeNewMonkey needs to be implemented"); } // 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 reserve Animal 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"); } } import java.lang.String; public class RescueAnimal { // Instance variables private String name; private String animalType; private String gender; private String age; private String weight; private String acquisitionDate; private String acquisitionCountry; private String trainingStatus; private boolean reserved; private String in ServiceCountry; // Constructor public RescueAnimal() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAnimalType() { return animalType; } public void setAnimalType(String animalType) { this.animalType = animalType; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } public String getWeight() { return weight; } public void setWeight(String weight) { this.weight = weight; } public String getAcquisitionDate() { return acquisitionDate; } public void setAcquisitionDate(String acquisitionDate) { this.acquisition Date = acquisition Date; } public String getAcquisitionLocation() { return acquisitionCountry; } page view Read aloud Draw public void setAcquisition Location(String acquisitionCountry) { this.acquisition Country = acquisitionCountry; } public boolean getReserved() { return reserved; } public void setReserved(boolean reserved) { this.reserved = reserved; } public String getinService Location() { return in ServiceCountry; } public void setinServiceCountry(String in ServiceCountry) { this.inServiceCountry = in ServiceCountry; } public String getTrainingStatus() { return trainingStatus; } public void setTrainingStatus(String trainingStatus) { this.trainingStatus = trainingStatus; } } PLEASE ADD COMMENTS FOR BETTER UNDERSTANDING