Object oriented programming questions can u help. Container(Base)> Cylinder (Derived from Container)> Sphere (Derived from Container)Container class has three properties (height, width, radius)....


Object oriented programming questions can u help.


Task 1:<br>Implement the following class hierarchy.<br>> Container(Base)<br>> Cylinder (Derived from Container)<br>> Sphere (Derived from Container)<br>Container class has three properties (height, width, radius). Cylinder and<br>Sphere classes will have a volume function. You have to set values of<br>properties in order to display correct volume for Cylinder and Sphere and<br>you can't set those values through objects of Cylinder and Sphere.<br>Task 2:<br>Implement the following class hierarchy.<br>Person (Base)<br>> Student (Derived from Person)<br>> Teacher (Derived from Person)<br>Person class has following private attributes:<br>• Name<br>Age<br>• Address<br>• Phone Number<br>Student class has following private attributes:<br>• Semester<br>Cgpa<br>Teacher class has following private attributes:<br>• Qualification<br>• Experience<br>Student and Teacher classes will have a display function which display<br>the complete information of a Student or a Teacher including his name,<br>age, address and phone number.<br>

Extracted text: Task 1: Implement the following class hierarchy. > Container(Base) > Cylinder (Derived from Container) > Sphere (Derived from Container) Container class has three properties (height, width, radius). Cylinder and Sphere classes will have a volume function. You have to set values of properties in order to display correct volume for Cylinder and Sphere and you can't set those values through objects of Cylinder and Sphere. Task 2: Implement the following class hierarchy. Person (Base) > Student (Derived from Person) > Teacher (Derived from Person) Person class has following private attributes: • Name Age • Address • Phone Number Student class has following private attributes: • Semester Cgpa Teacher class has following private attributes: • Qualification • Experience Student and Teacher classes will have a display function which display the complete information of a Student or a Teacher including his name, age, address and phone number.
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here