Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Write a Java program which prompts the user to type in the width and length of a room

0 votes
asked Oct 31, 2019 by anonymous
Then  calculate and display the perimeter and floor surface area of the room in a dialog box

1 Answer

0 votes
answered Nov 1, 2019 by Bhaskor Adhikari (180 points)

import java.util.Scanner;

public class Main{

public static void main(String[] args) {

  Scanner keyboard =new Scanner(System.in);

    

  

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

double length=keyboard.nextDouble();

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

double width=keyboard.nextDouble();

    double area;

    area=0.5*length*width;

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

        

        

}

}

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...