Question: Try to make random collection of objects from below tasks, and in loop call some polymorph method. 1. Describe the class of objects EquilateralTriangle with

Try to make random collection of objects from below tasks, and in loop call some polymorph method.

1. Describe the class of objects EquilateralTriangle with possibility to calculate own Area. Describe the derived class IsoscelesTriangle with other formula of Area. Implement a method with the same name in both classes to display the parameters of the object.

2. Describe the class of objects RightTriangle, with values of catheti and implement property Perimeter. Describe the derived class Triangle, with values of three sides and overwrite property of Perimeter. Implement a method with the same name in both classes to display the parameters of the object.

3. Describe the class of objects RightTriangle with values of catheti and implement property Area. Describe the derived class Rectangle, with values of two sides and overwrite property of Area. Implement a method with the same name in both classes to display the parameters of the object.

4. Describe the class of objects RightTriangle with values of catheti and implement property Perimeter. Describe the derived class Rectangle, with values of two sides and overwrite property of Perimeter. Implement a method with the same name in both classes to display the parameters of the object.

5. Describe the class of objects Square with value of side and implement property Area. Describe the derived class Rectangle, with values of two sides and overwrite property of Area. Implement a method with the same name in both classes to display the parameters of the object.

6. Describe the class of objects Square with value of side and implement property Perimeter. Describe the derived class Rectangle, with values of two sides and overwrite property of Perimeter. Implement a method with the same name in both classes to display the parameters of the object.

7. Describe the class of objects r, with trademark (string) and method of moving. Describe the derived class Lorry, with carrying capacity and method of loading. Implement a method with the same name in both classes to display the parameters of the object.

8. Describe the class of objects Liquid, with property Name. Describe the derived class Alcohol, with property Strength. Implement a method with the same name in both classes to display the parameters of the object.

9. Describe the class of objects Man, with property Age. Describe the derived class Student, with property Average grade. Implement a method with the same name in both classes to display the parameters of the object.

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