37.3k views
5 votes
In order to paint a wall that has a number of windows, we want to know its area. Each window has a size of 2 ft by 3 ft. Write a program that reads the width and height of the wall and the number of windows,.

User Elarcoiris
by
8.5k points

1 Answer

3 votes

Answer:

6ft

Step-by-step explanation:

Step 1:

import java.util.Scanner;

class AreaOfRectangle {

public static void main (String[] args)

{

Scanner scanner = new Scanner(System.in);

System.out.println("Enter the length of Rectangle:");

double length = scanner.nextDouble();

System.out.println("Enter the width of Rectangle:");

double width = scanner.nextDouble();

//Area = length*width;

double area = length*width;

System.out.println("Area of Rectangle is:"+area);

}

}

Output

Enter the length of Rectangle:

2

Enter the width of Rectangle:

3

Area of Rectangle is:6.0

User Katfang
by
7.8k points