Question: create a superclass Shape with 2 attributes X, Y with a constructor, getters, setters, toString, and 2 abstract methods one is an area, and one
create a superclass Shape with 2 attributes X, Y
with a constructor, getters, setters, toString, and 2 abstract methods one is an area, and one is the circumference
And create 3 subclasses: Square, Rectangle, and Circle
Put the suitable attributes for each class and let each one complete the abstract methods
In the main create an array list of the shapes to contain details about all different shapes.
allow the user to enter the value X for the shapes then print all details of a shape that has its value x equal to the entered value, and for each of them tell if its a square, rectangle, or circle and print its area.
Step by Step Solution
There are 3 Steps involved in it
Python Code import math class Shape def initself x y selfx x selfy y def areaself pass def circumferenceself pass def strself return fShapexselfx yselfy class SquareShape def initself x y side superin... View full answer
Get step-by-step solutions from verified subject matter experts
