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
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