Rectangle Tester
The Java API describes a Rectangle
class that can be used to manipulate virtual rectangle objects.
Write a RectangleTester.java
program that:
- imports the Rectangle class
- constructs a Rectangle object
- computes and prints its area, using the
.getWidth()
and .getHeight()
methods
- prints the expected area
- computes and prints the perimeter using those same methods
- prints the expected perimeter