Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions