Answer to Question #14177 in C++ for Leigh

Question #14177
A painting company has determined that for every 115 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 the labor.
4. Display the following details in an organized form:
a. The required number of gallons of paint
b. The required hours of labor
c. The labor charges
d. The total cost of the painting job
Using structure and functions
1
Expert's answer
2012-11-08T06:44:08-0500
#include <iostream>
#include <conio.h>
using namespace std;
struct PaintingCompany {
double galonsOfPaint,labor, hours, total;
}test;

void print(){
cout<<"Galons of paint needed: " << test.galonsOfPaint << endl;
cout<<"Hours needed: "<< test.hours << endl;
cout<<"Labor needed: $"<< test.labor << endl;
cout<<"Total: $"<< test.total << endl;
}

int main ()
{
int wallLength;
cout<<"Enter the length of the wall: ";
cin >> wallLength;
test.hours = (wallLength*8)/115;
test.galonsOfPaint = test.hours/8.0;
test.labor = test.hours*20;
test.total = test.labor;
print();
system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS