[SOLVED] Rectangle class in Java

10.00 $

Categories: ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Rectangle-1.zip (4 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
šŸ”’ Securely Powered by:
Secure Checkout
5/5 - (3 votes)
Design a class name Rectangle to represent a rectangle.

Two double data fields named width and height that specify the width and the height of the rectangle. The default values are 1 for the width and the height.

A no-arg constructor that creates a default rectangle .
A constructor that creates a rectangle with the specified width and height.
A method named getAre() that returns the area of the rectangle.
A method name gerPerimeter() that returns the perimeter.
Write a test program that creates two rectangle objects-one with width 4 and height 40 and the other with the width 3.5 and height 35.9. Display the width, height , area, and the perimeter of each rectangle in this order.

  • Rectangle-1.zip