Question: Question need help with is below: Considering the following code snippets define the classes that are asked as follows- class Car : public iVehicle {

Question need help with is below:

Considering the following code snippets define the classes that are asked as follows-

class Car : public iVehicle {

char m_name[31];

public:

Car(const char* name) {

strcpy(m_name, name);

}

void move() {

cout << "Move like a car" << endl;

}

void speed() {

cout << "Speed like a car" << endl;

}

void display(iostream& os)const {

cout << m_name << " is a car" << endl;

}

};

1) Create the interface class iVehicle, assuming that all of its member functions are overridden by member functions of Car.

2) Create an abstract class named Truck publicly derived from the interface iVehicle class. The Truck class will have an integer type private data member named "m_speed". The Truck class will only implement the move() public member function.

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 Programming Questions!