Question
can anyone please help with asap Create an abstract class called GeometricObject. This class has abstract methods for calculating perimeter and area. Design a Triangle
can anyone please help with asap
Create an abstract class called GeometricObject. This class has abstract methods for calculating perimeter and area.
Design a Triangle class that extends the abstract GeometricObject class. You have to provide the length of the three sides of the triangle in the constructor. Provide concrete implementations for area and perimeter methods.
Create a Circle class that extends the abstract GeometricObject class. You have to provide the radius of the circle in the constructor. Provide concrete implementations for area and perimeter methods.
Create an array of GeometricObjects and store 3 triangles and 2 circles of various sizes in this array. Loop over this array and output the areas and perimeters of each GeometricObject in the following format:
Type : Circle Radius: 6.0 Perimeter: 24.0 Area: 36.0
Type: Triangle Side 1: 5.0 Side 2: 4.0 Side 3: 3.0 Perimeter: 17.0 Area: 25.0
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