Question: In java: 1. Design a class named Rectangle to represent a rectangle. The class contains: Two double data fields named length and width that specify
1. Design a class named Rectangle to represent a rectangle. The class contains: Two double data fields named length and width that specify the length and width of the rectangle. A no-arg constructor that creates a default rectangle. The default values are 1 for both length and width. A constructor that creates a rectangle with the specified length and width A method named calculate Area() that returns the area of this rectangle. A method named calculate Perimeter() that returns the perimeter. 2. Write a Manager class that creates two Rectangle objects one with length 4 and width 40 and the other with length 3.5 and width 35.9. The Manger class shall print the area and perimeter of both Rectangle objects
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
