Question
I need help. I have copied and pasted my source code for PAINTJOBESTIMATOR. but heres what i need to fix. I need to figure out
I need help. I have copied and pasted my source code for PAINTJOBESTIMATOR. but heres what i need to fix. I need to figure out square footage for the user rather than make them give that to me. Make it easy for the user- ask them for the length and width of the room - assume 4 walls 8 feet high, 2 are 8 x length feet and 2 are 8 x width feet. You figure out sq ft from this information. Please help.
import java.util.Scanner; import java.text.DecimalFormat;
public class PaintJobEstimator {
public static void main (String args[]) { int sizeOfWall= 115; int gallon = 1; int hoursOfLabor= 8; int laborCostPerHour= 18; Scanner scan= new Scanner(System.in); DecimalFormat formatter= new DecimalFormat("#0.00"); System.out.print(" Enter the number of rooms "); double numberOfRooms = scan.nextDouble(); System.out.print("Enter the amount of wall space in"+ " each room (square feet please): "); double sizeRoom = scan.nextDouble(); System.out.print(" Enter the price of paint per gallon: "); double priceOfPaint = scan.nextDouble(); double roomCostUnit = (sizeRoom * numberOfRooms)/sizeOfWall; double numberOfGallons = met1(gallon, roomCostUnit); System.out.print(" The number of gallons of paint is: " + numberOfGallons); double hoursRequired = met2(hoursOfLabor, roomCostUnit); System.out.print(" The hours of labor required is: " + hoursRequired); double ans3 = met3 (priceOfPaint, numberOfGallons); System.out.print(" The cost of the paint is: " + ans3); double ans4 = met4 (hoursRequired, laborCostPerHour); System.out.print(" The labor fee will be: " + ans4); double ans5 = ans3 + ans4 ; System.out.print(" The total cost of the paint job is: " + ans5); } public static double met1( double gallon, double roomCostUnit) { double result; result = gallon *roomCostUnit; return result; } public static double met2 (double hoursOfLabor, double roomCostUnit) { double result; result = hoursOfLabor * roomCostUnit; return result; } public static double met3 (double priceOfPaint, double numberOfGallons) { double result; result = numberOfGallons * priceOfPaint; return result; } public static double met4 ( double hoursRequired, double laborCostPerHour) { double result; result = hoursRequired*laborCostPerHour; return result; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started