Question
Description: Create an object-oriented program that performs calculations on a rectangle in PYTHON Console: Rectangle Calculator Height: 10 Width: 20 Perimeter: 60 Area: 200 Continue?
Description: Create an object-oriented program that performs calculations on a rectangle in PYTHON
Console:
Rectangle Calculator Height: 10 Width: 20 Perimeter: 60 Area: 200 Continue? (y/n): y Height: 5 Width: 10 Perimeter: 30 Area: 50 Continue? (y/n): n
Bye!
Specifications:
Use a Rectangle class that provides attributes to store the height and width of a rectangle. This class should also provide methods that calculate the perimeter and area of the rectangle.
When the program starts, it should prompt the user for height and width. Then, it should create a Rectangle object from the height and width and use the methods of that object to get the perimeter, area, and string representation of the object.
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