Question: #include using namespace std; class vehicle { private: int age; float price; public: vehicle() { age = 0; price = 0; } void setage(int agehold)

#include

using namespace std;

class vehicle {

private:

int age;

float price;

public:

vehicle() { age = 0; price = 0; }

void setage(int agehold) { age = agehold; }

void setprice(float pricehold) { price = pricehold; }

int getage() { return age; }

float getprice() { return price; }

};

class car :public vehicle

{

private:

bool raceCarStatus;

public:

car() { raceCarStatus = false; }

void setRaceCarStatus(bool race) { raceCarStatus = race;}

bool getRaceCarStatus() { return raceCarStatus; }

};

class truck:public vehicle

{

private:

bool dieselTypeStatus;

public:

truck() { dieselTypeStatus = false; }

void setDieselTypeStatus(bool status) { dieselTypeStatus = status; }

bool getDieselTypeStatus() { return dieselTypeStatus; }

};

int main()

{

vehicle v;

v.setage(5);

v.setprice(95.32);

cout<<"vehicle age is "<

cout << "vehicle price is " << v.getprice() << endl;

car c;

c.setage(532);

c.setprice(4932.02);

c.setRaceCarStatus(false);

cout << "age of the CAR: " <

cout << "price of the CAR: " << c.getprice()<

cout << "racecar status(1 for yes 0 for no): " << c.getRaceCarStatus() << endl;

truck t;

t.setage(53342);

t.setprice(124932.02);

t.setDieselTypeStatus(true);

cout << "age of the TRUCK: " << t.getage() << endl;

cout << "price of the TRUCK: " << t.getprice() << endl;

cout << "diesel fuel status(1 for yes 0 for no): "

<< t.getDieselTypeStatus() << endl;

system("pause");

return 0;

}

1.)

Draw three UML class diagrams, one for each of the classes mentioned above

2.)

Draw a generalization among the three class diagrams, showing the inheritance

relationship.

3.) turn this code into pseudocode

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!