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 are whole-numbers only. It
should then display 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
Input validation: Do not accept a value less than 1 for the number
of rooms. Do not accept a value less than $10.00 for the price of
paint. Do not accept a negative value for square footage of wall
space.
Use the following string literals:
"Room " ": "
"Enter the number of rooms to be painted: "
"ERROR: Enter 1 or greater.\n"
"Enter the number of rooms to be painted: "
"Enter the price of the paint, per gallon: "
"ERROR: Paint price must be 10.00 or greater.\n"
"Enter the price of the paint, per gallon: "
"Enter the area of wall space in square feet: "
"ERROR: Wall area must be a non-negative number.\n"
"Enter the area of wall space in square feet: "
"\nESTIMATED CHARGES\n"
"------------------\n"
"Gallons of paint: "
"Price per gallon: $"
"Paint cost: $"
"Hours of labor: "
"Total charges: $"
Using the following test data:
2, 39.95, 112, 80
Your output should look like this:
Enter the number of rooms to be painted: 2 Enter the
price of the paint, per gallon: 39.95 Room 1: Enter the area of
wall space in square feet: 112 Room 2: Enter the area
of wall space in square feet: 80
ESTIMATED CHARGES
------------------
Gallons of paint: 2
Price per gallon: $39.95
Paint cost: $79.90
Hours of labor: 13.96
Total charges: $428.99
This is c++ and please let the code works on VS2017.
please show the output same as the output I gave you. Thank you.
If you need any corrections, kindly comment.
If you like the answer please give a Thumps Up
Program
#include <iostream>
#include<stdlib.h>
#include<iomanip>
#include <cmath>
using namespace std;
void estimate(float square_footage, float price_gallon);
int main()
{
int num_rooms,i;
float square_footage=0,price_gallon,area ;
//Input the number of rooms to be
painted.
cout<<"Enter the number of rooms to be
painted:";
cin>>num_rooms;
while(num_rooms<1)
{
cout<<"ERROR: Enter 1 or
greater"<<endl;
cout<<"Enter the number of rooms to be
painted:";
cin>>num_rooms;
}
//Input the price of the paint per gallon.
cout<<"Enter the price of the paint per
gallon:";
cin>>price_gallon;
while(price_gallon<10)
{
cout<<"ERROR: Paint price must be 10.00 or
greater"<<endl;
cout<<"Enter the price of the paint per
gallon:";
cin>>price_gallon;
}
for(i=0;i<num_rooms;i++)
{
//Input the square footage of wall space to be
painted.
cout<<"Room "<<i+1<<": Enter
the area of wall space in square feet:";
cin>>area;
while(area<0)
{
cout<<"ERROR: Wall area must be a
non-negative number"<<endl;
cout<<"Room "<<i+1<<": Enter
the area of wall space in square feet:";
cin>>area;
}
square_footage+=area;
}
estimate(square_footage,price_gallon);
system ("PAUSE");
return 0;
}
void estimate(float square_footage, float price_gallon)
{
float
num_gallons,hours_labor,total_price_gallon,total_labor,final_total;
// 110 sq ft = 1 gallon + 8 hrs of labor (labor
is $25 per hour)
cout << fixed << showpoint <<
setprecision(2);
num_gallons = square_footage/110;
hours_labor = num_gallons * 8;
total_price_gallon = round(num_gallons) *
price_gallon;
total_labor = hours_labor * 25;
final_total = total_price_gallon +
total_labor;
cout<<"\nESTIMATED CHARGES\n";
cout<< "------------------\n";
cout<<"Gallons of Paint
:"<<round(num_gallons)<<endl;
cout<<"Price per gallon
:$"<<price_gallon<<endl;
cout<<"Paint Cost
:$"<<total_price_gallon<<endl;
cout<<"Hours of labor
:"<<hours_labor<<endl;
cout<<"Total Charges:
$"<<final_total<<endl;
}
Output
A painting company has determined that for every 110 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...
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....
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 120 square feet of wall area, one gallon of paint and eight hours of labor is required. The company charges US$ 18.00 per hour for labor. Write a modular program that allows the user to enter the number of rooms that are to be painted and the price of...
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 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. 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...
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...
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...
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...
CENGAGE MINDTAP gramming Exercise 3-8 PaintCalculator.java Instructions Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompts the user for the length, width, and height of a rectangular room. Pass these three values to a method that does the following: 1 import java.util.Scanner; 2 public class PaintCalculator { 3 public static void main(String args[]) { // Write your code here public static double computeArea double length, double...