Design a class named Automobile that includes • A data member named currentSpeed • A setCurrentSpeed function to set currentSpeed of an automobile • A getCurrentSpeed function to get currentSpeed of an automobile Derive a class named Car inherited from Automobile class and contains • An additional data member named color • A parameterized constructor to initialize its own data fields along with the inherited data field • Two functions named setColor and getColor to set and get the color of a Car object, respectively Derive a class named Limousine inherited from class Car and has its own functions (i.e. setCurrentSpeed, getCurrentSpeed, setColor and getColor) to set/get speed and color for each of its specific instance
Design a class named Automobile that includes
• A data member named currentSpeed
• A setCurrentSpeed function to set currentSpeed of an automobile
• A getCurrentSpeed function to get currentSpeed of an automobile
Derive a class named Car inherited from Automobile class and contains
• An additional data member named color
• A parameterized constructor to initialize its own data fields along with the inherited data
field
• Two functions named setColor and getColor to set and get the color of a Car object,
respectively
Derive a class named Limousine inherited from class Car and has its own functions (i.e.
setCurrentSpeed, getCurrentSpeed, setColor and getColor) to set/get speed and color for each of
its specific instance
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images