Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

What is a red flag with respect to financial statement analysis?

Answered: 1 week ago

Question

which of the following CANNOT be used to fill a shape

Answered: 1 week ago