Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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 2018

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_2

Step: 3

blur-text-image_3

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

please try to give correct answer 2 8 3 . .

Answered: 1 week ago