82 333
Assignments Done
99,6%
Successfully Done
In January 2020

# Answer to Question #47023 in Java | JSP | JSF for ram

Question #47023
A handyman company has decided to specialize in two tasks: painting and carpeting rooms. Write a Java application to determine the cost of a room to be painted or carpeted. One gallon of paint and eight hours of labor are required for every 12.7 square yards of space that needs to be painted. One hour of labor is required for every five square yards of carpet to be laid. The charge for labor is \$18.00 per hour
1
2014-09-24T12:05:09-0400
import java.util.Scanner;
public class Main {
/**
* Main method
* @param args
*/
public static void main(String[] args) {
//Scanner for keyboard
Scanner scanner =new Scanner(System.in);
//variable for square painted
double squarePainted;
//variable for square carpeted
double squareCarpeted;
//variable for cost painted
double costPainted=0;
//variable for cost carpeted
double costCarpeted=0;
//prompt user to enter square yards of space that needs to be painted
System.out.print(&quot;Enter square yards of space that needs to be painted: &quot;);
squarePainted=scanner.nextDouble();
//prompt user to enter square yards of space that needs to be carpeted
System.out.print(&quot;Enter square yards of space that needs to be carpeted: &quot;);
squareCarpeted=scanner.nextDouble();

//calculate the cost of a room to be painted
costPainted=(squarePainted/12.7)*8*18;
//calculate the cost of a room to be carpeted
costCarpeted=(squareCarpeted/5)*18;
//show result
System.out.println(&quot;\nThe cost of a room to be painted: &quot;+costPainted);
System.out.println(&quot;The cost of a room to be carpeted: &quot;+costCarpeted);
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!