A painting company has determined that for every 115 squarefeet of wall space, 1
ID: 3608824 • Letter: A
Question
A painting company has determined that for every 115 squarefeet of wall space, 1 gallon of paint and 2 hours of labor will berequired. The company charges $34.00 per hour of labor. Write aprogram using functions that allows the user to enter the number ofrooms that are to be painted and the price of paint per gallon.Also enter the square feet of wall space for each room.You must use 6 functions whose prototypes are as follows: int numRooms () int numGals (float area) float paintPrice () float wallArea () float laborHrs (float) void displayCost (int gallons, float paintPrice, floatlaborHrs) You are to use the following input values: 1. Number of Rooms = 3 2. Price of paint per gallon = $22.50 3. Square feet Room-1 = 180 Room-2 = 144 Room-3 = 300 The output for the program is to: The number of gallons of paintrequired---- 6 The hours of laborrequired---------------- 5.426 Total cost ofpaint------------------------- $135.00 Total cost ofLabor----------------------- $ Total cost ofjob-------------------------- $ A painting company has determined that for every 115 squarefeet of wall space, 1 gallon of paint and 2 hours of labor will berequired. The company charges $34.00 per hour of labor. Write aprogram using functions that allows the user to enter the number ofrooms that are to be painted and the price of paint per gallon.Also enter the square feet of wall space for each room.
You must use 6 functions whose prototypes are as follows: int numRooms () int numGals (float area) float paintPrice () float wallArea () float laborHrs (float) void displayCost (int gallons, float paintPrice, floatlaborHrs) You are to use the following input values: 1. Number of Rooms = 3 2. Price of paint per gallon = $22.50 3. Square feet Room-1 = 180 Room-2 = 144 Room-3 = 300 The output for the program is to: The number of gallons of paintrequired---- 6 The hours of laborrequired---------------- 5.426 Total cost ofpaint------------------------- $135.00 Total cost ofLabor----------------------- $ Total cost ofjob-------------------------- $
Explanation / Answer
please rate - thanks your number of hours is incorrect : it is 2 hours of labor forevery gallon of paint, so that must be about double gallons ofpaint. I had to add a parameter to wallAreasince I had to get the 3 rooms into it #include using namespace std; int numRooms (); int numGals (float); float paintPrice (); float wallArea (int); float laborHrs (float); void displayCost (int , float, float ); int main() {int rooms,i,gals; float ppg, wall,hrs; rooms=numRooms(); ppg=paintPrice(); wall=wallArea(rooms); gals=numGals(wall); hrs=laborHrs(wall); displayCost (gals, ppg, hrs); system("pause"); return 0; } void displayCost (int gallons, float paintPrice, floatlaborHrs) {cout.setf(ios::fixed,ios::floatfield); cout.precision(2); float cost,lcost,pcost; pcost=paintPrice*gallons; lcost=laborHrs*34; cost=lcost+pcost; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.