Create (define and implement) a base class Shape classes that
will inherit this class called Box, Rectangle, Circle, and
Triangle
Programming Specifications:
Deliverables:
Square Perimeter:
4 * side.
Square Area:
side*side
Rectangle Perimeter:
Side1*2 + Side2*2
Rectangle Area:
Side1 * Side2
Circle Area:
Pi * Radius*Radius
Circle Perimeter:
Pi * 2*Radiuis
Triangle Area:
Assume we know three sides (Side1, Side2, Side3) then the area
based on Heron’s formula which gives the area in terms of the three
sides of the triangle. First calculate s which is
(Side1 + Side2 + Side3)/2. Then obtain the square root
of the absolute value of following
formula: s*(s – Side1)*(s – Side2)*(s – Side3).
Create (define and implement) a base class Shape classes that will inherit this class called Box, Rectangle, Circle, and
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am