Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Artistic Solutions, a painting company, has determined that for every 160 square

ID: 3625479 • Letter: A

Question

Artistic Solutions, a painting company, has determined that for every 160 square feet of wall space, one gallon of paint and three hours of labor are required. the company charges $28.00 per hour of labor. Design a modular program that allows the user to enter the number or rooms that are to be painted, the approximate square feet of wall space in each room(it may differ from room to room), and the price of the paint per gallon.It should then create a report that includes a fancy company header and displays the following information:



• The number of gallons of paint required(rounded up to the next full gallon)

• the hours of labor required

• the cost of the paint

• the labor charges

• the total cost of the pain job





Input validation: the program should not accept a value less than 1 or more than 12 for the number of rooms or a value less than 100 for the square footage of a room. It should not accept a value less than $10.00 or more than $25.00 for the price of a gallon of paint.





any help is appreciated,

thx

Explanation / Answer

//Header file section

#include<iostream>

#include<iomanip>

using namespace std;

void PaintEstimater(double avg,int gallonprice)

{

//local declaration

float paintQuantity=0,laborHour=0,

              paintCost=0,laborCharges=0,totalCost=0;

//calculating gallons needed

paintQuantity=paintQuantity+avg/160;

//calculating labour hours

laborHour=laborHour+paintQuantity*3;

//calculating paint cost

paintCost=paintCost+gallonprice*paintQuantity;

   //calculating labour charges

laborCharges=laborCharges+laborHour*28;

//total cost

totalCost=totalCost+paintCost+laborCharges;

//outputting data

cout<<" The number of gallons of paint required: "

                  <<setprecision(3)<<paintQuantity<<endl;

cout<<"The hours of labor required are: "

                                  <<laborHour<<endl;

cout<<"The cost of the paint is: "<<paintCost<<endl;

cout<<"The labor charges are: "<<laborCharges<<endl;

cout<<"The total cost of the paint job is "

                                    <<totalCost<<endl;

}

void main()

{

int rooms;

double avg=0,wallspace, gallonprice ;

cout<<"Enter number of rooms: ";

cin>>rooms;

while (rooms<1 || rooms>12)//validate rooms

{

    cout<<"ERROR: The rooms range must be from 1to12.

                               Reenter number of rooms: ";

    cin>>rooms;

   }

for (int x=1 ; x<=rooms ; x++)

{

    cout<<"Enter wall space in square meter for room: "

                                                <<x<<": ";

    cin>>wallspace;

    while (wallspace < 100)//validate wallspace

    {

      cout<<"ERROR: Reenter wall space in square meter for     

                                    room: "<<x<<" again: ";

      cin>>wallspace;

    }

   avg=avg+wallspace;

}//end for

   cout<<" Enter price of paint per gallon: ";

    cin>>gallonprice;

   while (gallonprice <10 || gallonprice >25)

                             //validate price

     {

       cout<<"ERROR: Reenter price of paint per gallon

                      which will less than 10: ";

        cin>>gallonprice;

      }

PaintEstimater(avg,gallonprice);

//pause system for a while

system("pause");

}//end main

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote