Make abstract class called Animal attributes of size and weight and movement=4.5 method Move which has integer
Question:
Make abstract class called Animal
attributes of size and weight and movement=4.5
method "Move" which has integer parameter numberSeconds and returns double called distance
method will multiple movement times numberSeconds and return that distance
Create class called Turtle that inherits animal
Assign size=6, weight = 8
Create class called Bird
Assign size=3
Do polymorphism on method Move where the distance = movement*movement*numberSeconds
Make AnimalDriver Class
Create instance of turtle and determine how far it moved in 10 seconds
Print out "turtle" along with size, weight and distance moved
Create two birds bird1 and bird2
Assign weight bird1 = 15, bird2=20
Determine distance for bird1 at 10 seconds and bird2 at 20 seconds
Print out "bird1" along with size, weight and distance moved
Print out "bird2" along with size, weight and distance moved
In your text file first put all four classes (Animal, Turtle, Bird, and AnimalDriver) then word OUTPUT and then output from executing driver.
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates