Question: Write a program that implements the ADT vehicle (a class with at least one pure virtual function). Information you may want to keep about a
Write a program that implements the ADT vehicle (a class with at least one pure virtual function). Information you may want to keep about a vehicle includes
identification information
empty weight
maximum gross weight
maximum range
maximum speed
The constructor should take all such information as arguments. Include virtual functions (may be pure or impure) for interrogating each such attribute. Also include a pure virtual function for interrogating the transportation mode.
Construct derived classes airplane, boat, and car each derived directly from vehicle. Each derived class should provide an interrogation function for the transportation mode, which should indicate by-air, by-land, or by-water (or something similar).
Write a short program which instantiates at least one object of each derived type. Verify all operations work correctly.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
