The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
For this assignment you are to create a Rectangle data class and an executable program to test it
(Â ^^ This means two seperate files!, use the import keyword in the test program to import the Rectangle class ).
Refer to the UML diagram below to create the Rectangle class. See page 462-463 regarding UML diagrams.
| Rectangle |
|
__length |
|
__init__(length,width) |
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
NOTE: the area() method returns the area and perimeter() returns the perimeter.
In the executable's main function:
SAMPLE OUTPUT
Enter the length 12.45
Enter the width 8.973
Length: 12.45
Width: 8.973
Rectangle area is 111.71
Rectangle perimeter is 42.85
Changed rectangle area is 352.81
Changed rectangle perimeter is 76.27
-----------