Question: In the language python: (The rectangle class) design a class named rectangle to represent a rectangle. The class contains: -Two data field named width and

In the language python:

(The rectangle class) design a class named rectangle to represent a rectangle. The class contains:

-Two data field named width and height

-a constructor that creates a rectangle with a specified width and height. The default values 1 and 2 for the width and height, respectively

-a method named getArea() that returns the area of this rectangle

-a method named getPerimeter() that returns the perimenter

-Define width and height as private data fields of the class

-Include the public methods getWidth( ) and getHeight( ) in the class

Test these functions with calls from main( ) for the two given data sets

All four numbers in bold above should be produced by appropriate function calls to the getter methods of the class..

Create a UML (Unified Modeling Language) diagram for your Rectangle class.

** the program should allow user to enter any input

** the program should print out 1 decimal places

output example: A 4 x 40 rectangle has an area of 160 and a perimeter of 88.

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!