logo CodeStepByStep logo

Toad

("Critter" classes come from Marty Stepp's "Critters" homework assignment. See "Critters spec" link above for more information.)

Define a Critter class named Toad with the following behavior:

constructor public Toad()
color brown (red=192, green=128, blue=0)
eating behavior never eats (this is the default eating behavior)
fighting behavior always forfeits in a fight (this is the default fighting behavior)
movement behavior moves west once every 5 moves

C, C, C, C, W, C, C, C, C, W...

toString "T"
Inheritance: Write a Java class using inheritance.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.