Sei sulla pagina 1di 1

Try to describe an Interface and to implement it partly in Abstraction.

Try to inherit description in real classes.

0. Describe the class of objects IntegerNumber with property MultipliedBy2. Describe the
derived class Circle, with radius and Circumference (2∙π∙r). Implement a method with the same
name in both classes to display the parameters of the object. (is a?)

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.

Potrebbero piacerti anche