C++ Assume the following code is written: class TransportationVehicle { private: string Type; // e.g., pedicycle, motorcycle, car, truck, boat string powered By; // e.g., foot, wind, gas, electricity public: TransportationVehicle(string type="unknown", power="unknown") { Type = type; powered By = power; } string getVehicleType() { return Type; } string getPowertype() { return poweredBy; } void setType(string type) { Type = type; } void setPowersource(string source) { poweredBy = source; } } Write a complete class definition for a class Car that is a subclass of Transportation Vehicle. Include at least a default constructor and a full constructor as well as get and set methods and any other constructors or methods you feel should belong. The class Car should have an int called gears and an int called doors. The default for gears is 4 and the default for doors is 2 (which is also the minimum). The default for powered By should be gas (though electric or hybrid are possibilities). Many other attributes are possible, but you | should limit your answer to the required attributes.
C++ Assume the following code is written: class TransportationVehicle { private: string Type; // e.g., pedicycle, motorcycle, car, truck, boat string powered By; // e.g., foot, wind, gas, electricity public: TransportationVehicle(string type="unknown", power="unknown") { Type = type; powered By = power; } string getVehicleType() { return Type; } string getPowertype() { return poweredBy; } void setType(string type) { Type = type; } void setPowersource(string source) { poweredBy = source; } } Write a complete class definition for a class Car that is a subclass of Transportation Vehicle. Include at least a default constructor and a full constructor as well as get and set methods and any other constructors or methods you feel should belong. The class Car should have an int called gears and an int called doors. The default for gears is 4 and the default for doors is 2 (which is also the minimum). The default for powered By should be gas (though electric or hybrid are possibilities). Many other attributes are possible, but you | should limit your answer to the required attributes.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 6RQ
Related questions
Question
100% correct program otherwise i will downvote
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,