Question: Create an abstract class, called Shapes. In the class, declare a constant PI whose value is 3.14159, and declare an abstract method, call getArea() which

Create an abstract class, called Shapes. In the class, declare a constant PI whose value is 3.14159, and declare an abstract method, call getArea() which returns a double. Then,

A. Create a class, called Circle, which extends the Shape class, and has its own data member(s), constructor(s), mutator(s), and accessor(s).

B. Create a class, called Rectangle, which extends the Shape class, and has its own data member, constructor(s), mutator(s), and accessor(s).

C. Test two classes in an application class. At least display areas of a circle and rectangle.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!