Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design a program for a builder that allows the user to select flooring options f

ID: 3759614 • Letter: D

Question

Design a program for a builder that allows the user to select flooring options for building a home.The program should use an input dialog box to explain the purpose and use of the program, list flooring options, and ask the user to select one of the options by a numeric value. Use the switch statement. Display an information dialog box to display the selection made,the description, and the price. Use the following descriptions for the program:

This program asks the user to enter a choice of flooring for a new home

Enter the number that matches your flooring choice

1:Scored concrete, costs$3000

2: Carpeting comes with a $5000 allowance

3: Wood floors in the living area,carpeting in the bedrooms,tile in the bath areas,and a $5000 carpet allowance, totaling $10,000

Explanation / Answer

import javax.swing.JOptionPane;
public class Flooring
{
public static void main(String[] args)
{
String OString1, OString2, OString3, OString4, OString5;
int num;
OString1 =JOptionPane.showInputDialog("The program that ask the user to enter a choice of flooring for a home" + " " + "Enter the number that matches your flooring choice:" + " " + " " + "1: Scored Concrete: Costs $3000" + " " + " " + "2: Carpeting comes with $5000 allowance" + " " + " " + "3: Wood floors in the living area," + " " + "carpeting in the bedrooms, tile in the bath areas," + " " + "and a $5000 carpet allowance, totalling $10,000");
num = Integer.parseInt(OString1);
switch (num)
{
case 1:
OString2 = "You chose selection 1: Scored concrete, costs $3000";
JOptionPane.showMessageDialog(null, OString2, "Flooring Program", JOptionPane.DATA_MESSAGE);
break;
case 2:
OString3 = "You chose selection 2: Carpeting; comes with $5000 allowance";
JOptionPane.showMessageDialog(null, OString3, "Flooring Program", JOptionPane.DATA_MESSAGE);
break;
case 3:
OString4 = "You chose selection 3: Wood floors in the living area," + " " + "carpeting in the bedrooms, tile in the bath areas," + " " + "and a $5000 carpet allowance, totalling $10,000";
JOptionPane.showMessageDialog(null, OStringr4, "Flooring Program", JOptionPane.DATA_MESSAGE);
break;
default:
OString5 = "Invalid Entry";
JOptionPane.showMessageDialog(null, OString5, "Flooring Program", JOptionPane.DATA_MESSAGE);
break;
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote