ANSWER IN C++: THUMBS UP!! PLEASE ANSWER ACCORDING TO CONDITIONS
GIVEN IN THE QUESTION: USING THE GIVEN MATERIAL IN THE
QUESTION.
Question 3: Define the SUV class for testing virtual base classes as follows:
class SUV : public PassCar, public Van {
private:
public:
SUV(...):Car(...)
// Initialize additional data members
void display() const
PassCar::display();
Van::display(); // Output additional data members
}
3.1) Change the definition of the PassCar class in the car.h header file to make Car a virtual base class of the PassCar class.
3.2) Then define the Van class using the Car class as a virtual base class. The new class should contain an additional data member used to represent the payload of the van in kilograms. A maximum of 750 kg applies to vans. The constructor should use default values to initialize the data members with defaults, thus providing a default constructor for the class. A maximum value of 750 applies for the payload. In addition to the access method displayO, you still need to define methods for screen output.
3.3) Create the class SUV, which is derived from PassCar and Van, to represent a station wagon. Store the number of seats available in the station wagon as a data member. The constructor in the SUV class should use the base initializer to set all the values of a station wagon using default values for every data member. Additionally, define access methods and a displayO to define output.
3.4) Use a main function to test the SUV class; the function should create station wagons with and without default values and display them on screen.