Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Container Relationships & Inheritance Homework 1. Create two classes, A and B, w

ID: 3814923 • Letter: C

Question

Container Relationships & Inheritance Homework 1. Create two classes, A and B, with default constructors that announce of themselves. Inherit a new class called C from A, and create a member object B in C, but do not create a constructor for C. In main (0, create an object of class C and explain the results. 2. Create a three-level hierarchy of classes with default constructors, along with destructors, both of which announce themselves to cout. Verify that for an object of the most derived type, all three constructors and destructors are automatically called. Explain the order in which the calls are made. 3. 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 Air Vehicle and Sea what design issues had to be considered in developing the SeaPlane class? 4. Without executing the code below, give the output for the program. class A protected: int fai public: A (int van 0) fa (va) cout "A constructor endl. A (const A6 va) fa (va fa cout "A copy constructor endli -A cout "A destructor endl; As operator" (const A6 va) cout "A operator endli fa va fa; return *this;

Explanation / Answer

1.

Class A

{

System.out.println("default constructor");}

}

Class b

{

System.out.println(" class b");

B()

{

System.out.println("default constructor b");}

}

Class c extends A

{

System.out.println("class c");

B b = new B();

}

Class inheritance

{

Public static void main( String args[])

{

C c1= new C();

}

}

In this class A represents the class A and the A() inside is the constructor of class A . Then in the same way we are creating a class B and with default constructor B().

Then we have created class c in this we are creating an object for class c.

And finally in the main class we have created object for the class c so thay by calling this function all my other functions like a and b because these are inherited.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote