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]
4 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]4 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
What is the value of the result after the following statement is executed? int result = 2 + 3 + 4 ;
kow [346]

2 + 3 + 4 = 9 so the value of result is also 9

8 0
3 years ago
A poker hand consists of 5 cards drawn at random without replacement from a 52 card deck. Using python and the cards data frame
PSYCHO15rus [73]

Answer:

# Python program to shuffle a deck of card

# importing modules

import itertools, random

# make a deck of cards

deck = list(itertools.product(range(1,14),['Spade','Heart','Diamond','Club']))

# shuffle the cards

random.shuffle(deck)

# draw five cards

print("You got:")

for i in range(5):

  print(deck[i][0], "of", deck[i][1])

Output

You got:

5 of Heart

1 of Heart

8 of Spade

12 of Spade

4 of Spade

Explanation:

5 0
3 years ago
Declare a variable named
zlopas [31]

The declared variable name populationChange suitable for holding numbers like  -593142 and 8930522 is as follows:

populationChange = -593142

populationChange = 8930522

<h3>Variable:</h3>

Variable are containers use for storing values of different datatypes. Python variable can be use to store various datatype without indicating the datatype. The variable can be used to store float, string, integer etc.

For example

myVariable = 345

The variable named populationChange that holds numbers like -593142 and 8930522 can be declared as follows;

populationChange = -593142

populationChange = 8930522

Note the code is written in python

learn more on python variable here: brainly.com/question/21335728

3 0
2 years ago
What is best method for modern businesses to authorize the use of workplace resources to its employees
Reika [66]
<span>Assign them a user authentication and password.</span>
3 0
3 years ago
Read 2 more answers
Adopting technologies can improve productivity and performance of businesses.
rewona [7]

An area of improvement that can be achieved using AI and Machine in the Future of Transport are given below:

The technical issues of artificial intelligence are

  • Artificial Neural Networks.
  • Deep Learning.
  • Natural language processing.

The potential issues that can arise from the adoption of AI technology

is hacking of transport system and system fail and how it can be overcome is by aiding system with enough security as well as regular maintenance.

<h3>What is the Future of Transport about?</h3>

AI is known to be one that has the power as well as the potential to be able to make traffic in regards to movement of vehicles to be very more efficient.

Note that it is one that can ease traffic congestion and also gives driver's a lot of time, also make parking easier as well as encourage car or ridesharing.

Note that as AI aids or function to keep road traffic to be flowing, it can also lower the  fuel consumption rate that is as a result of the use of  vehicles idling if stationary,

Learn more about AI from

brainly.com/question/25523571

#SPJ1

5 0
2 years ago
Other questions:
  • Which microphones are considered to have the best quality?
    12·2 answers
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • With the _______ network topology, reliability is the major advantage while high cost is the disadvantage.
    13·1 answer
  • Is 583 a string or a number?
    13·2 answers
  • What is the purpose of the 5 Whys Strategy? How could you use the 5 Whys strategy in your day-to-day life? (Site 2)
    5·1 answer
  • Convert 3BA.25 (base 14) to base 6 ? Show all arithmetic in decimal
    5·1 answer
  • Write a program with the total change amount as an integer input, and output the change using the fewest coins, one coin type pe
    13·1 answer
  • Advantages against its counterpart because of its portability​
    8·1 answer
  • Who is this wrong answers only
    7·1 answer
  • Why big data influnce the rise of AI<br><br>​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!