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.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 6RQ
icon
Related questions
Question

100% correct program otherwise i  will downvote

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.
Transcribed Image Text: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.
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Data members
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,