In Java, create a program to determine the perimeter and area of a rectangle. Write a rectangle class with a separate runner class. Allow the user to input the rectangle length and width. All should be tested in a runner. You need: file input using scanner, instance variables, constructors, minimum of 3 objects and 3 methods.
Example:
Please enter the length of the rectangle (in inches): 6
Please enter the width of the rectangle (in inches): 10
The area of the rectangle is 60 inches. The perimeter is 32 inches. Would you like to run another (y/n)?
Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
import java.util.*;
class Rectangle
{
private double l,w;
public Rectangle(double l,double w)
{
this.l=l;
this.w=w;
}
public double getArea()
{
return l*w;
}
public double getPeri()
{
return 2*(l+w);
}
public void printInfo()
{
System.out.println("The area of the rectangle is "+getArea()+"
inches. ");
System.out.println("The perimeter is "+getPeri()+" inches.");
}
}
public class Runner {
public static void main (String [ ] args)
{
Scanner sc=new Scanner(System.in);
char choice='y';
while(choice!='n'&&choice!='N')
{
System.out.println("Please enter the length of the rectangle (in
inches): ");
double l,w;
l=sc.nextDouble();
System.out.println("Please enter the width of the rectangle (in
inches): ");
w=sc.nextDouble();
Rectangle r=new Rectangle(l,w);
r.printInfo();
System.out.println("Would you like to run another (y/n)?: ");
choice=sc.next().charAt(0);
}
}
}

Kindly revert for any queries
Thanks.
In Java, create a program to determine the perimeter and area of a rectangle. Write a...