Create (define and implement) a base class Shape classes that will inherit this class called Box, Rectangle, Circle, and

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Create (define and implement) a base class Shape classes that will inherit this class called Box, Rectangle, Circle, and

Post by answerhappygod »

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).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply