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 P120.00 per hour for labor. Write a program that allows the user to enter the number of rooms 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. The program should have functions that return the following data: · The number of gallons of paint required · The hours of labor required · The cost of the paint · The labor charges · The total cost of the paint job Then it should display the data on the screen.
The Answer to the Question
is below this banner.
Can't find a solution anywhere?
NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?
Get the Answers Now!You will get a detailed answer to your question or assignment in the shortest time possible.
Here's the Solution to this Question
#include <iostream>
int nubmerOfRooms;
int foots[10001];
int totalFoots = 0;
int calcNumberOfGallons(int n) {
return (n + 114) / 115;
}
int requiredHours(int n) {
return 8 * n;
}
double laborCharges(int n) {
return 120.00 * n;
}
int main() {
scanf("%d", &numberOfRooms);
for (int i = 0; i < numberOfRooms; i++) {
scanf("%d", &foots[i]);
totalFoots += foots[i];
}
int n;
printf("%d", (n = calcNumberOfGallons(totalFoots)));
printf("%d", (n = requiredHours(n)));
printf("%f", laborCharges(n));
return 0;
}