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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started