Write a program that computes the cost of painting and installing carpet in a ro
ID: 3636545 • Letter: W
Question
Write a program that computes the cost of painting and installing carpet in a room. Assume that the room has one door, two windows, and one bookshelf. Your program must do the following:1. Prompts the user to enter in feet, length, width and height of a room.
2. Prompts the user to enter the widths and heights, in feet of the door, each window and bookshelf.
3. Prompts the user to enter cost, per square foot of installing carpet and painting the walls.
4. Outputs the cost of the painting and installing carpet.
Explanation / Answer
//************************************… //File: Paint.java // //Purpose: Determine how much paint is needed to paint the walls //of a room given its length, width, and height //************************************… import java.util.Scanner; public class Paint { public static void main(String[] args) { final int COVERAGE = 300; //paint covers 300 sq ft/gal //declare integers length, width, and height; //declare double totalSqFt; //declare double paintNeeded; //declare and initialize Scanner object //Prompt for and read in the length of the room //Prompt for and read in the width of the room //Prompt for and read in the height of the room //Compute the total square feet to be painted--think //about the dimensions of each wall //Compute the amount of paint needed //Print the length, width, and height of the room and the //number of gallons of paint needed. } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.