USING SWIFT 3 - Your friend Joe is a painter. He has asked you to help him out b
ID: 3589223 • Letter: U
Question
USING SWIFT 3 - Your friend Joe is a painter. He has asked you to help him out by creating a program to that will estimate his paint jobs. Joe's records indicate that one gallon of paint covers 380 square feet and requires about eight hours of labor, including trim. He charges $35.00 per hour for his labor. Create a function that takes two arguments: the number of square feet for the job, and the cost of the paint. The function should calculate and display an estimate Joe can present to his customers. It should include the following: The number of gallons of paint required for the job The hours of labor required The cost for the necessary paint The labor charges The total cost for the job
Explanation / Answer
Please find the required function : TotalEstimate(Long noOfSqFeets, Double costOfPaint)
//Function in java
public static void TotalEstimate(Long noOfSqFeets, double costOfPaint){
Long noOfGallonReq = 0;
noOfGallonReq = (noOfSqFeets/380);
int hrsOfLaborReq = ((noOfSqFeets * 8)/380);
Double costOfPaintReq = (noOfGallons * costOfPaint);
Long LabourCharges = (hrsOfLabour * 35);
System.out.println("Total Estimation");
System.out.println("No. of gallons of paint required= " +noOfGallonReq );
System.out.println("The total hrs of labour required = " +hrsOfLaborReq );
System.out.println("The total cost of paint required = " + costOfPaintReq );
}
Please let me know if this answer is helpful.
Thanks.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.