Check this code for this assignment: It runs successfully on Netbeans IDE but there is no output. // Create a Scanner object to read user input         Scanner input = new Scanner(System.in);         // Prompt the user to enter the street number         System.out.print("Enter street number: ");         int streetNumber = input.nextInt();         input.nextLine();         // Prompt the user to enter the street name         System.out.print("Enter street name: ");         String streetName = input.nextLine();         // Prompt the user to enter the number of rooms in the house         System.out.print("Enter number of rooms: ");         int numRooms = input.nextInt();         input.nextLine();         // Create an array to store the room types         String[] roomTypes = { "living", "dining", "bedroom1", "bedroom2", "kitchen", "bathroom" };         // Create an array to store the area of each room         int[] roomAreas = new int[6];         // Prompt the user to enter the area of each room         for (int i = 0; i < 6; i++) {             System.out.print("Enter area of " + roomTypes[i] + " room: ");             roomAreas[i] = input.nextInt();             input.nextLine();         }         // Prompt the user to enter the price per sq. ft.         System.out.print("Enter price per sq. ft.: ");         double pricePerSqFt = input.nextDouble();         // Calculate the total area of the house         int totalArea = 0;         for (int i = 0; i < 6; i++) {             totalArea += roomAreas[i];         }         // Calculate the estimated property value         double estimatedValue = totalArea * pricePerSqFt;         // Display the results         System.out.println("\n1.                   Street: " + streetName + " #" + streetNumber);         System.out.print("2.              Total Rooms: " + numRooms + " (");         for (int i = 0; i < 6; i++) {             System.out.print(roomTypes[i]);             if (i < 5) {                 System.out.print(", ");             }         }         System.out.println(")");         System.out.println("3.               Total Area: " + totalArea + " sq. ft.");         System.out.println("4.         Price per sq. ft: $" + pricePerSqFt);         System.out.println("5. Estimated property value: $" + estimatedValue);     }      }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

 Check this code for this assignment: It runs successfully on Netbeans IDE but there is no output.

// Create a Scanner object to read user input
        Scanner input = new Scanner(System.in);

        // Prompt the user to enter the street number
        System.out.print("Enter street number: ");
        int streetNumber = input.nextInt();
        input.nextLine();

        // Prompt the user to enter the street name
        System.out.print("Enter street name: ");
        String streetName = input.nextLine();

        // Prompt the user to enter the number of rooms in the house
        System.out.print("Enter number of rooms: ");
        int numRooms = input.nextInt();
        input.nextLine();

        // Create an array to store the room types
        String[] roomTypes = { "living", "dining", "bedroom1", "bedroom2", "kitchen", "bathroom" };

        // Create an array to store the area of each room
        int[] roomAreas = new int[6];

        // Prompt the user to enter the area of each room
        for (int i = 0; i < 6; i++) {
            System.out.print("Enter area of " + roomTypes[i] + " room: ");
            roomAreas[i] = input.nextInt();
            input.nextLine();
        }

        // Prompt the user to enter the price per sq. ft.
        System.out.print("Enter price per sq. ft.: ");
        double pricePerSqFt = input.nextDouble();

        // Calculate the total area of the house
        int totalArea = 0;
        for (int i = 0; i < 6; i++) {
            totalArea += roomAreas[i];
        }

        // Calculate the estimated property value
        double estimatedValue = totalArea * pricePerSqFt;

        // Display the results
        System.out.println("\n1.                   Street: " + streetName + " #" + streetNumber);
        System.out.print("2.              Total Rooms: " + numRooms + " (");
        for (int i = 0; i < 6; i++) {
            System.out.print(roomTypes[i]);
            if (i < 5) {
                System.out.print(", ");
            }
        }
        System.out.println(")");
        System.out.println("3.               Total Area: " + totalArea + " sq. ft.");
        System.out.println("4.         Price per sq. ft: $" + pricePerSqFt);
        System.out.println("5. Estimated property value: $" + estimatedValue);
    }
    
}

Write a program to calculate an estimation of a real estate property value.
1. Declare variables to hold the data fields for:
■ Street number
■ Street name
▪ The number of rooms in the house
▪
Five string variables for types of rooms: (living, dining, bedroom1, bedroom2, kitchen,
bathroom, etc.)
▪ Five integer variables for the area of each room in sq. ft.
▪ Price per sq. ft., for example, $150.50 (store this value as double.)
2. Prompt the user for each of the above fields. Read console input and store entered values in
the corresponding variables.
IMPORTANT: Make sure that the street name can be entered with embedded spaces, for
example, "Washington St" and "Park Ave" are both valid street names.
3. Compute total area of the house (total sq. ft.) and multiply it by the Price per sq. ft. to
compute the estimated property value.
4. Display the results in the following format. IMPORTANT: Your program should keep the
line count in a separate variable and print the line numbers in your report using that variable
as shown:
1.
Street:
2.
Total Rooms:
Total Area:
3.
4.
Price per sq. ft: $
5. Estimated property value: $
Coding Requirements
Always have a block comment on top of the program describing assignment number, author,
and what it does.
(List entered rooms here)
sq. ft.
Label the end of your class and the end of the main method with appropriate "ending"
comments:
public class your class name goes here
{
}//main
public static void main(String[] args)
{
}//class your class name goes here
Maintain your coding standard:
o Align verically each opening and closing brace { }
o Indent program statements
• Use appropriate variable naming convention
Add comments where necessary.
Transcribed Image Text:Write a program to calculate an estimation of a real estate property value. 1. Declare variables to hold the data fields for: ■ Street number ■ Street name ▪ The number of rooms in the house ▪ Five string variables for types of rooms: (living, dining, bedroom1, bedroom2, kitchen, bathroom, etc.) ▪ Five integer variables for the area of each room in sq. ft. ▪ Price per sq. ft., for example, $150.50 (store this value as double.) 2. Prompt the user for each of the above fields. Read console input and store entered values in the corresponding variables. IMPORTANT: Make sure that the street name can be entered with embedded spaces, for example, "Washington St" and "Park Ave" are both valid street names. 3. Compute total area of the house (total sq. ft.) and multiply it by the Price per sq. ft. to compute the estimated property value. 4. Display the results in the following format. IMPORTANT: Your program should keep the line count in a separate variable and print the line numbers in your report using that variable as shown: 1. Street: 2. Total Rooms: Total Area: 3. 4. Price per sq. ft: $ 5. Estimated property value: $ Coding Requirements Always have a block comment on top of the program describing assignment number, author, and what it does. (List entered rooms here) sq. ft. Label the end of your class and the end of the main method with appropriate "ending" comments: public class your class name goes here { }//main public static void main(String[] args) { }//class your class name goes here Maintain your coding standard: o Align verically each opening and closing brace { } o Indent program statements • Use appropriate variable naming convention Add comments where necessary.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education