Question & Answer: Note; PLEASE DON'T FORGET TO INCLUDE COMMENTS ON EVERY SIGNIFICANT LINE OF A CODE PLEASE……

Note; PLEASE DON’T FORGET TO INCLUDE COMMENTS ON EVERY SIGNIFICANT LINE OF A CODE PLEASE.

A painting company has determined that for every 100 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. Write a program that allows the user to enter the number of rooms (10pts) to be painted and the price of the paint per gallon. It should also ask for the square feet of wall space in each room (10 pts). The program should have methods that return the following data:

The number of gallons of paint required (15 pts)

The hours of labor required (15 pts)

The cost of the paint (15 pts)

The labor charges (15 pts)

The total cost of the paint job (15 pts)

Then it should display the data on the screen. (5 pts).

package name paint

To receive full credit make sure you display input dialogs and message dialogs and also comment in every significant line of a code.

Expert Answer

 

#include<iostream>

using namespace std;

int gallonPaintRequired(int no_of_rooms,int square_feet_wall)

{

/* for every 100 square feet of wall space, one gallon of paint is required,

so for square_feet_wall ,(1/100) * square_feet_wall gallon paint required */

float gallon_paint = (1*square_feet_wall)/100;

return (no_of_rooms * 4 * gallon_paint);

}

int hoursOfLabor(int no_of_rooms,int square_feet_wall)

{

/* for every 100 square feet of wall space, one 8 hours are required,

so for square_feet_wall ,(8/100) * square_feet_wall hours required */

float hours = (8*square_feet_wall)/100;

return (no_of_rooms * 4 * hours);

}

int main()

{

int no_of_rooms,price_per_gallon,square_feet_wall;

cout<<“Enter the number of rooms”<<endl;

cin>>no_of_rooms;

cout<<endl<<“Enter price per gallon”<<endl;

cin>>price_per_gallon;

cout<<endl<<“Enter square feet wall”<<endl;

cin>>square_feet_wall;

cout<<“The number of gallons of paint required: “<<gallonPaintRequired(no_of_rooms,square_feet_wall)<<endl;

cout<<“The hours of labor required: “<<hoursOfLabor(no_of_rooms,square_feet_wall)<<endl;

float totalgallonprice = price_per_gallon * gallonPaintRequired(no_of_rooms,square_feet_wall);

cout<<“The cost of the paint:”<<totalgallonprice<<endl;

float totallaborprice = 20 * hoursOfLabor(no_of_rooms,square_feet_wall);

cout<<“The labor charges: “<<totallaborprice<<endl;

cout<<“The total cost of the paint job: “<<totalgallonprice + totallaborprice <<endl;

return 0;

}

Still stressed from student homework?
Get quality assistance from academic writers!