1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
blagie [28]
3 years ago
11

A painting company has determined that for every 115 square feet or wall space, one gallon of paint and eight hours of labor wil

l be required. The company charges $.18.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 methods that return the following:
* 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
Computers and Technology
1 answer:
Kay [80]3 years ago
7 0

The program to calculate the total paint cost and other values is given below.

#include <iostream>

using namespace std;

int main() {  

 int rooms, laborChrg = 18;

 float paintChrg;

 float feetPerRoom[rooms];  

 float paintReq, laborHrs, paintCost, laborCost, totalCost, totalsqft=0;  

 cout<<"Enter the number of rooms to be painted "<<endl;

 cin>>rooms;  

 for(int i=0; i <= rooms; i++)

 {

 cout<<"Enter the square feet in room "<<endl;

 cin>>feetPerRoom[i];  

 // shortcut operator which is equivalent to totalsqft = totalsqft +     feetPerRoom[i];

 totalsqft += feetPerRoom[i];

 }  

 cout<<"Enter the cost of the paint per gallon "<<endl;

 cin>>paintChrg;  

 laborHrs = (totalsqft/115)*8;

 laborCost = laborHrs * laborChrg;  

 paintReq = totalsqft/115;

 paintCost = paintReq * paintChrg;  

 totalCost = laborCost + paintCost;  

 cout<<"The number of gallons of paint required "<<paintReq<<endl;

 cout<<"The hours of labor required "<<laborHrs<<endl;

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

 cout<<"The labor charges are "<<laborHrs<<endl;

 cout<<"The Total cost of the paint job is "<<totalCost<<endl;  

 return 0;

}

Explanation:

The header files for input and output are imported.

#include <iostream>

using namespace std;

All the variables are taken as float except labour charge per hour and number of rooms.

The user is asked to input the number of rooms to be painted. An array holds the square feet in each room to be painted.

cout<<"Enter the number of rooms to be painted "<<endl;

cin>>rooms;  

for(int i=0; i <= rooms; i++)

{

cout<<"Enter the square feet in room "<<endl;

cin>>feetPerRoom[i];  

totalsqft += feetPerRoom[i];

}  

The above code asks for square feet in each room and calculates the total square feet to be painted simultaneously.

All the data to be displayed is calculated based on the values of labor charge per hour and gallons of paint needed, given in the question.

laborHrs = (totalsqft/115)*8;

laborCost = laborHrs * laborChrg;

paintReq = totalsqft/115;

paintCost = paintReq * paintChrg;

totalCost = laborCost + paintCost;

All the calculated values are displayed in the mentioned order.

You might be interested in
Potential Energy and Kinetic Energy both mean "energy in motion" True or False​
Irina18 [472]

Answer:

false

Explanation:

pretty sure energy in motion is only for kinetic energy

4 0
3 years ago
Read 2 more answers
Do you agree that digital signatures are the best way to protect the data in question?
lutik1710 [3]

Answer:

Explained

Explanation:

Yes, I agree that digital signatures are the best way to protect the data in the date in question. A digital signature is mathematical technique used to validate the authenticity and integrity of a massage. Digital signature is far more inherent security. It is built to solve problems of tempering and impersonation of digital documents. It allows the authorized user to have authentic right, and the unauthorized person is denied access.

3 0
3 years ago
What does "CPU" stand for?
MrMuchimi
Central processing unit
7 0
3 years ago
Read 2 more answers
What are the supercomputers and where are they used? ​
viktelen [127]

Answer:

Giant Tech Company mostly

Explanation:

they used it as their server or storing data, right now example we googling by that we send the requests from our computer to supercomputers and those computer will find that information your and send back the respond (e.g. website Brainly). Supercomputers = computers sample as that.

6 0
2 years ago
What term is defined as software that allows users to use and adapt it for any purpose, often allowing the public to participate
Alex787 [66]

Answer:

The answer is open source

Explanation:

hope this helps

# look it up on google

6 0
3 years ago
Other questions:
  • An _________ is a phrase formed from the first letters of words in a set phrase or series of words a. Acronymic sentence c. Basi
    7·2 answers
  • What bus carries a status signal back to the CPU?
    14·1 answer
  • An indirect effect of an action, be it a cost or benefit, for a third party who did not agree to the action is known as a(n) ___
    8·1 answer
  • HELP! ASAP I KNOW IT'S QUITE A HANDFUL BUT I NEED THIS ANSWER!!
    10·1 answer
  • End user needs assessment is a formal procedure to analyze a user's computer needs; it involves a specific set of steps that are
    8·1 answer
  • 2. What is a cap? (0.5 points)
    9·1 answer
  • For what kind of shot is a fisheye lens most appropriate?
    8·1 answer
  • Help plz,l didn’t pay attention in class
    7·1 answer
  • CSCU EXAM TEST FINAL1-A software or hardware that checks information coming from the Internet and depending on the applied confi
    6·1 answer
  • Explain the correct ways of using keyboard. .​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!