Question
In Java: As part of an architectural design program, write a main method that prompts the user to enter length and width dimensions for each
In Java:
-
As part of an architectural design program, write a main method that prompts the user to enter length and width dimensions for each room in a proposed house so that total floor space can be calculated for the entire house.
-
After each length/width entry, ask the user if there are any more rooms.
-
Print the total floor space.
-
Here is the beginning of the code. You need to complete the rest of the program:
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
double length, width; // room dimensions
double floorSpace = 0; // house's total floor space
String response; // user's y/n response
do
{
System.out.print("Enter the length: ");
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started