1. Defi ne and implement a class Pen that has an instance of Ball as one of its members. Provide several members for the class Pen , such as the data member color and methods isEmpty and write .
2. Consider the following classes:
• LandVehicle represents a vehicle that travels on land. Its public methods include wheelCount and speed .
• MotorizedLandVehicle represents a land vehicle that has a motor. Its public methods include engineCapacity and fuelType .
a. Which of the methods mentioned previously can the implementation of speed invoke?
b. Which of the methods mentioned previously can the implementation of engineCapacity invoke?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here