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.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here