Ok it's all about to create 4 class
Class a , class b derived from a and c derived from b and test class
Speed is an instance variable in class b and c.
The method are :
Start() -a method of all class to print the message"hee" override the method in class b and c to print ""hoo" and "hmm" correspondingly
Stop() -a method of class a to print a message"cool" override the method in class b and c to print the "stop"and "stop c" correspondingly
Setspeed() -a method of class b and c to set the value of speed with the value passed to the method .make sure that maximum speed allowed for class b is 75 km/h .if the value to be assigned to speed is more than that assign 75 to E and print the message "over". Similarly the maximum speed for class c is 200 km/h the same for class c
Getspeed(). - a method of class b and c return speed
Increasespeed(). -a method of class b and c .increase the speed with the given value make sure that if the increased value of speed more than 75 km/h for class b then set speed to 75 and print message" neew" dobthe same for class c print the new speed
Write a test class in java and let the user to chose the shape by displaying a menu like below:
1.a
2.b
3.c
4.exit
If the user enter 1 create an instance of class a and call all the method of class a. And make it the same with class b and c call the method in the same class when he chose 4 stop then terminate the program
Make the user to enter their choices repeatedly (use loop) until they press 4 to exit