Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago

Question

f. What stereotypes were reinforced in the commercials?

Answered: 1 week ago