Design and implement a class Frog. Each Frog object has a name and keeps track of the number of times it leaps. Define two constructors, set and get methods for each data field, and the method...



Design and implement a class Frog. Each Frog object has a name and keeps track of the number of times it leaps. Define two constructors, set and get methods for each data field, and the method toString. Also, define a method jump that simply increments the number of times the frog has jumped by 1. Demonstrate your class by creating three Frog objects. The output from this demonstration might appear as follows:


Kermit has leapt 5 times.


Kermit has leapt 8 times.


Legs has leapt 0 times.


Frogger has leapt 3 times.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here