Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In a new Java file, create the Monkey class ( click File then New and then Class ) and populate the new class with code
In a new Java file, create the Monkey class click File then New and then Class and populate the new class with code using the specification document as a guide. The Monkey class must perform the following functions:
Inherit from the RescueAnimal class.
Implement all attributes with proper data types 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 into the constructor as parameters and assigns them to the class attributes. 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 criteria:
Displays the menu by calling the displayMenu method. This method is in the Driver.java class.
Prompts the user for input using a scanner object.
Takes the appropriate action based on the value that the user entered.
Important: You do not need to complete all 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 must 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 prepopulate your ArrayList with a few test monkey objects in the initializeMonkeyList method.
Finally, implement the intakeNewMonkey method in the Driver.java class. Your completed method should perform the following actions:
Prompt the user for input.
Set data for all attributes based on user input.
Add the newly instantiated monkey to an ArrayList.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started