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

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));
   }
}

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