Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview Nearly every Java application involves multiple classes. As you have learned, designing a program around classes and objects is a key feature of object-oriented

Overview Nearly every Java application involves multiple classes. As you have learned, designing a program around classes and objects is a key feature of object-oriented programming and provides many benefits, such as more readable and maintainable code. However, it is not enough to just have multiple classes. You also need to make sure that these classes can work together within a program. This involves making sure that any relationships, such as inheritance, are properly implemented in the code. It also involves having a main() method, usually located in a special class called the Driver class, that runs the program. In this assignment, you will gain experience putting together a multiple-class program by creating a class that inherits from another (existing) class, and modifying or implementing methods in the Driver class. This milestone will also give you the opportunity to begin coding a part of the solution for Project Two. This will allow you to get feedback on your work before you complete the full project in Module Seven. Prompt To gain a clear understanding of the clients requirements, review the Grazioso Salvare Specification Document. As you read, pay close attention to the attributes and methods that you will need to implement into the program. Open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open the Eclipse IDE. Follow the Uploading Files to Eclipse Tutorial to upload the Grazioso.zip folder into Eclipse. The Grazioso.zip folder contains three starter code files: Driver.java, RescueAnimal.java, and Dog.java. Once you have uploaded the files, compile the code. Although the program is not complete, it should compile without error. Read through the code for each class that you have been given. This will help you understand what code has been created and what code must be modified or created to meet the requirements. You have been asked to demonstrate industry standard best practices in all the code that you create 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 RescueAnimal 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 takes all values for the attributes and sets them. Refer to the constructor in the Dog class for an example. Include accessors and mutators for all implemented attributes. In the Driver.java class, 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 Takes the appropriate action based on the value that the user entered IMPORTANT: You do not need to complete all of the methods included in the menu for this milestone. Simple placeholder print statements for these methods have been included in the starter code so that you can test your menu functionality. Next, you will need to create a monkey ArrayList in the Driver.java class. Refer to the dog ArrayList, which is included right before main(), as an example. Creating this ArrayList is necessary for the intakeNewMonkey() method, which you will implement in the next step. Though it is not required, it may be helpful to pre-populate your ArrayList with a few test monkey objects in the initializeMonkeyList() method. Finally, you will implement the intakeNewMonkey() method in the Driver.java class. Your completed method should do the following: Prompt the user for input. Set data for all attributes based on user input. Add the newly instantiated monkey to an ArrayList. Tips: Remember to refer to the accessors and mutators in your Monkey and RescueAnimal classes as you create this method. Additionally, you should use the nextLine method of the scanner to receive the users input. Refer back to Section 1.15 in zyBooks for a refresher on how to use this method. Guidelines for Submission Use the Downloading Files from Eclipse Tutorial to help you download your completed class files. Be sure to submit your milestone even if you were not able to complete every part, or if your program has compiling errors. Your submission for this milestone should be the Grazioso.zip folder containing all four of the following files: RescueAnimal.java Class File: You were not required to make changes to this file, but you must include it as part of your submission. Dog.java Class File: You were not required to make changes to this file, but you must include it as part of your submission. Monkey.java Class File. You created this class from scratch, implementing attributes, a constructor, accessors, and mutators. You should have included in-line comments and clear variable naming conventions. Driver.java Class File. You were given some starter code within this file, and were asked to modify or implement a menu loop and methods to intake dogs, intake monkeys, reserve animals, and print animals. You should have included in-line comments to describe your changes.

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

d. Is it part of a concentration, minor, or major program?

Answered: 1 week ago

Question

What are our strategic aims?pg 87

Answered: 1 week ago