Question

C++, please make it as simple as possible.

A Paint Company is hiring you to develop an application to estimate the costs for a job. They have determined that for every

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

Output:

RAW CODE:

#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
void estimateCostAndPrintReport(double areaToBePainted,double priceOfGallonOfPaint){
   int gallons,hours;
  
   double cost_of_material,cost_of_labor,total_cost;
  
   gallons=ceil(areaToBePainted/120); //calculating total gallons required
  
   cout << "Number of gallons of paint required: " << gallons <<"."<< endl;
  
   hours=ceil((areaToBePainted*8)/120); //calculating hours of labour
  
   cout << "Hours of labour required = " << hours <<"."<< endl;
  
   cost_of_material=ceil(gallons*priceOfGallonOfPaint); //calculating total cost of material
  
   std::cout << std::setprecision(2) << std::fixed; //to make decimal to be two decimals
  
   std::cout<<"Total cost of material = US$ "<<cost_of_material<<"."<<std::endl;
  
   cost_of_labor=hours*18; //calculating total cost of labor
  
   std::cout<<"Total cost of labor = US$ "<<cost_of_labor<<"."<<std::endl;
  
   total_cost=cost_of_material+cost_of_labor; //total cost
  
   std::cout<<"Total cost of painting job (material + labor) = US$ "<<total_cost<<"."<<std::endl;
  
}
int main(){
   int rooms;
   double price,total_area=0; //initially total area is 0
   cout << "How many rooms will be painted? (minimum of one)"<< endl;
   cin >> rooms;
   while(rooms<=0){ //loop runs untill input is valid
       cout << "Number of Rooms needs to be at least one."<< endl;
       cout << "How many rooms will be painted? (minimum of one)"<< endl;
       cin >> rooms;
   }
   cout << "Enter the price for a gallon of paint."<< endl;
   cin>> price;
   while(price<10){ //loop runs untill the input for price is valid
       cout << "Gallon of paint should cost at least US$10.00."<< endl;
       cout << "Enter the price for a gallon of paint."<< endl;
       cin >> price;
   }
   for (int i=1;i<=rooms;i++){
       double area;
       cout << "Enter the area (Sqr ft) of wall to be painted in room "<<i<<"."<< endl;
       cin>>area;
       while(area<0){ //loop runs untill the area input is valid
           cout << "Area to be painted needs to be positive."<< endl;
           cout << "Enter the area (Sqr ft) of wall to ve painted in room "<<i<<"." <<endl;
           cin>>area;
       }
       total_area=total_area+area;
      
   }
   estimateCostAndPrintReport(total_area,price); //callling funcion
  
}

Hope you understand.if you have any doubts or if you want any modifications.please comment.

Thank you .Upvote me.

Add a comment
Know the answer?
Add Answer to:
C++, please make it as simple as possible. A Paint Company is hiring you to develop...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A painting company has determined that for every 110 square feet of wall space, one gallon...

    A painting company has determined that for every 110 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $25.00 per hour for labor. Write a modular program that allows the user to enter the number of rooms that are to be painted (different colors) and the price of the paint per gallon. It should also ask for the square feet of wall space in each room. Rooms and gallons...

  • Paint Job Estimator in Python and Raptor Psusedo

    Hello, I have seen this in Java and C++ but I am trying to learn it in Python ..any help on the code would be great..ThanksPaint job estimatorQuestion DetailsA painting company has determined that for every 115 square feet or 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 to be painted and the...

  • Tasks: Complete the following programs noted below: Problem 1: A painting company has determined that for...

    Tasks: Complete the following programs noted below: Problem 1: A painting company has determined that for 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program that asks the user to enter the square feet of wall space to be painted and the price of paint per gallon. The program should display the following data: The use of functions is required....

  • PLEASE HELP WITH CODE PYTHON BASE.!!!!!!!! Tasks: Complete the following programs noted below: Problem 1: A...

    PLEASE HELP WITH CODE PYTHON BASE.!!!!!!!! Tasks: Complete the following programs noted below: Problem 1: A painting company has determined that for 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program that asks the user to enter the square feet of wall space to be painted and the price of paint per gallon. The program should display the following data:...

  • This exercise requires designing a program which solves the problem described in the problem statement below....

    This exercise requires designing a program which solves the problem described in the problem statement below. Provide comments as necessary in your pseudo-code and the Java program. Your solution must include these components: Flowchart Pseudo-code Hierarchy Chart Program Coded Program Output Problem Statement A painting company has determined that to paint 115 square feet of wall space, the task will require one gallon of paint and 8 hours of labor. The company charges $20.00 per hour for labor. Design a...

  • I need to write a paint job estimator program in python. I have most of it...

    I need to write a paint job estimator program in python. I have most of it down but i keep getting errors and I dont know how to fix it or what im doing worng specs: A painting company has determined that for every 350 square feet of wall space, one gallon of paint and six hours of labor are required. The company charges $62.25 per hour for labor. Write a program call paintjobestimator.py that asks the user to enter...

  • A painting company has determined that for every 112 square feet of wall space, one gallon...

    A painting company has determined that for every 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program that asks the user to enter the square feet of wall space to be painted and the price of the paint per gallon. Use a function (or multiple functions if you want) to calculate the following values - you also need to output...

  • I need help making a javascript program to do the following: A painting company has determined...

    I need help making a javascript program to do the following: A painting company has determined that for every 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor and $15.00 for a gallon of paint. Write a function that takes in the number of square feet of wall space and displays the following data: The number of gallons of paint required The hours...

  • please explain in C++ only This program determines how much it cost to paint a room...

    please explain in C++ only This program determines how much it cost to paint a room Please write a program which determines and prints out three results. 1. The number of exact gallons of paint to paint the walls and the ceiling (NOT THE FLOOR) of the room if 1 gallon is enough to paint 400 square feet. 2. How many gallons of paint you need to buy since you cannot buy part of a gallon. So if you need...

  • in python please (1) Prompt the user to input a wall's height and width. Calculate and...

    in python please (1) Prompt the user to input a wall's height and width. Calculate and output the wall's area (integer). (Submit for 2 points). Enter wall height (feet): 12 Enter wall width (feet): 15 Wall area: 180 square feet (2) Extend to also calculate and output the amount of paint in gallons needed to paint the wall (floating point). Assume a gallon of paint covers 350 square feet. Store this value in a variable. Output the amount of paint...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT