Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am confused how to complete this assignment, Please help. In this activity you will create a grid locations that goes from -10 10, -10
I am confused how to complete this assignment, Please help.
In this activity you will create a grid locations that goes from -10 10, -10 10 On this grid you will keep track of various animal objects as they move around the grid. Make sure that all animals stay within that grid at al tines. Using Java, create the following classes and primary program that uses the classes that you developed. INSTRUCTIONS Create the following classes. ANIMAL CLASS Create an Animal class. Fach animal has a name, an x and y integer coordinate and a max spced which needs to be bctween 2 and 5. The Animal class should have at minimum the ollowing methods below: . A default constructor that starts the animal at 0,0 with a name of "unknown" and a max speed of 2. A parameter constructor that allows the programmer to input all 4 pieces of information. Check for the constraints. deem necessary o If the input value is invalid, adjust it any way you getx() gety) . toString() o This should print out the name and coordinates of the animal. touching(Animal x) This method should determine if the animal is on the same spot as the other animal (x). It should return a Boolean value of true if they are touching, and false if they are not on the same location. Revised: Fail 2018Step 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