Using java language A painting company has determined that for every 115 square
ID: 640562 • Letter: U
Question
Using java language
A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $20.00 per hour for labor. Design a modular program that asks the user to enter the square feet of wall space to be painted and the price of the paint per gallon. The program should display the following data:
- The number of gallons of paint required
- The hours of labor required
- The cost of the paint
- The labor charges
- The total cost of the paint job
Explanation / Answer
import java.util.Scanner;
public class PaintWalls {
public static void main(String args[]){
Scanner in = new Scanner(System.in);
double lPrice = 20.0, area, pPrice;
System.out.print("Enter square feet of wall space to be painted: ");
area = in.nextDouble();
System.out.print("Enter price of the paint per gallon: ");
pPrice = in.nextDouble();
double lHours = (area / 115.0) * 8;
double lCharges = lHours * lPrice;
double pCharges = (area / 115.0) * pPrice;
System.out.println("The number of gallons of paint required: " + (area / 115.0));
System.out.println("The hours of labor required: " + lHours);
System.out.println("The cost of the paint: " + pCharges);
System.out.println("The labor charges: " + lCharges);
System.out.println("The total cost of the paint job: " + (pCharges + lCharges));
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.