Question: HELP WITH JAVA CODE!!! COPY PASTE NEEDED (wanted output is listed) Create a Rectangle class, with 2 data fields, length, and height, both fields are
HELP WITH JAVA CODE!!! COPY PASTE NEEDED (wanted output is listed)

Create a Rectangle class, with 2 data fields, length, and height, both fields are double. Create set and get methods for the two data fields. Add two methods to the class. The first method, calculate Area() method calculates the area of a rectangle given the length and height of the rectangle ( height * length) and returns the area. The method requires the length and the height. The second method also uses the length and height to compute the perimeter and returns the perimeter. The calculate Perimeter() method calculates the perimeter of a rectangle given the length and height of the rectangle (height + length + height + length) and return the perimeter. Save the file as Rectangle.java. Create another class, TestRectangle.java, in the main() method test the rectangle class, create an instance of the rectangle class (height = 15.7; Length = 20.6). Then call the two methods to compute the area and perimeter. 1. Call the two methods in the main() method 2. Print the area and perimeter of the rectangle (height = 15.7; Length = 20.6) on the console using Systm.out.println(). The area of the rectangle is 323.42 The perimeter of the rectangle is 72.6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
