A painting company has determined that every 115 square feet of wall space, one
ID: 3598720 • Letter: A
Question
A painting company has determined that 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 labor. Design a modular program that asks the user to enter the square feet of wall space to be painted and the price of the paint per gallon. The program should display the following data:
1. the number of gallons of paint required
2. the hours of labor required
3. the cost of the paint
4. the labor charge
5. the total cost of the paint job
For example: if the user wants to paint 1000 square feet of wall space, and the price of the paint is $40.00 per gallon. Then
the paint job needs 1000/115 = 8.70 gallon
the cost of the paint 8.70 * 40.00 = $348.00
the paint job needs 8.70 * 8 = 70.6 hours
the cost of the labor is 70.6 * 20 = $1512
the total cost of the paint job: $348.00 + $1512 = $1860
Requirements:
1. pseudocode & flowchart
2. In addition to the main module, your algorithm should have at least two more modules. You decide the module name and if each module will accepts arguments. And you decide if the arguments will be passed by reference or passed by value.
3. please note that you need to change the mode to intermediate if you want to create/add procedure (module) in Raptor
4. please note that in a Raptor procedure, a parameter must be an output parameter if you want the procedure to change the parameter's value and return the new value back to where the procedure will be called
Explanation / Answer
Dear student,
I am providing you codde in C. I think it will be helpful to you.
#include <stdio.h>
int main(void) {
// your code goes here
double sqfeetreq;
double costpergallon;
scanf("%lf",&sqfeetreq); //user input of total sq feet to be painted
scanf("%lf",&costpergallon); //user input of cost per gallon
// As in question it is given that every 115 square feet of wall space, one gallon of paint
//and 8 hours of labor will be required. The company charges $20.00 per hour for labor
//therefore,for 1 sq feet,let "x" gallon ogf paint will be req
double x=0.008696; //x=1/115
// 1. the number of gallons of paint required
double noOfgallon=x*sqfeetreq;
//2. the hours of labor required
//let "y" hrs req for 1 sq feet
double y=0.069565;// y=8/115;
double hrs=y*sqfeetreq;
//3. the cost of the paint
double costofPaint=noOfgallon*costpergallon;
//4. the labor charge
double costofLabor=20*hrs; // AS, $20.00 per hour for labor
// 5. the total cost of the paint job
double totCost=(costofPaint+costofLabor);
printf("noOfgallon= %lf ",noOfgallon);
printf("time in hours= %lf ",hrs);
printf("costofPaint= %lf ",costofPaint);
printf("costofLabor= %lf ",costofLabor);
printf("totalCost= %lf ",totCost);
return 0;
}
Input:
1000
40
Output:
If having any difficulty in understanding above code pls comment .
Thank you !!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.