Write a Java program that calculates the area and perimeter of a rectangle given its length and width. You should implement the following methods:
- A method to calculate the area of the rectangle, given the length and width.
- A method to calculate the perimeter of the rectangle, given the length and width.
-
Create a new Java class and name it "RectangleCalculator".
-
Define the class and add the main method inside it.
-
Define two methods to calculate the area and perimeter of the rectangle. The methods should take two parameters, the length, and the width, and return the corresponding calculated values.
-
Inside the main method, take input from the user for the length and width of the rectangle.
-
Call the area and perimeter methods with the user-provided values and display the results.