Answered You can hire a professional tutor to get the answer.

QUESTION

As part of a military video game, a designer has created a vehicle class hierarchy. The base class IS Vehicle, and it has AirVehicle , LandVehicle...

1. As part of a military video game, a designer has created a vehicle class hierarchy. The base class IS Vehicle, and it has AirVehicle, LandVehicle

and SeaVehicle as derived classes. The class SeaPlane inherits from both AirVehicle and SeaVehicle. Specifically, what design issues had to be considered in developing the SeaPlane class?

2, What is the distinction between an abstract base class and a virtual base class?

3. Give the output for the following program without executing the code.

Class A,{

protected:

int fa;

public:

A(int va = O) : fa(va) {

cout << "A constructor " << endl;

}

A(const A& va) : fa(va.fa) {

cout << "A copy constructor " << endl;

}

~A () {

cout << "A destructor" << endl;

}

A& operator=(const A& va) {

cout << "A = operator" << endl;

fa = va.fa;

return *this;

}

class B : public A {

protected:

int fb;

public:

B(int va = 0, int vb = 0) : fb(vb), A(va) {

cout << "B constructor " << endl; }

B(const B& vb) : fb(vb.fb), A(Vb) {

cout << "B copy constructor " << endl;

~B()   {

cout << "B destructor" << endl;

}

B& operator=(const B& vb) {

cout << "B = operator" << endl;

A::operator=(vb);

fb = vb.fb;

return *this;

};

int main() {

B    b1(1, 2);

B    b2;

b2 = b1;

B    b3(b1);

return 0;

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question