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
nikklg [1K]
3 years ago
9

Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompt

s the user for the length, width, and height of a rectangular room. Pass these three values to a method that does the following: Calculates the wall area for a room Passes the calculated wall area to another method that calculates and returns the number of gallons of paint needed Displays the number of gallons needed Computes the price based on a paint price of $32 per gallon, assuming that the painter can buy any fraction of a gallon of paint at the same price as a whole gallon Returns the price to the main() method The main() method displays the final price. For example:
Computers and Technology
1 answer:
Makovka662 [10]3 years ago
5 0

Answer:

<em>C++</em>

#include <iostream>

#include <cmath>

using namespace std;

///////////////////////////////////////////////////////////////////////

int noOfGallons(int wallArea) {

   int gallon = 350;

   int gallon_price = 32.0;

   float total_price = 0.0;

   ///////////////////////////////////////////

   float noOfGallons = (float)wallArea/(float)gallon;

   printf("No of gallons needed %.2f", noOfGallons);

   cout<<endl;

   //////////////////////////////////////////

  total_price = noOfGallons*gallon_price;

   return round(total_price);

}

int wallArea(int length, int width, int height) {

   int wall_area = length*width;

   int total_price = noOfGallons(wall_area);

}

///////////////////////////////////////////////////////////////////////

int main() {

   int length, width, height;

   ///////////////////////////////////////////

   cout<<"Enter length: ";

   cin>>length;

   

   cout<<"Enter width: ";

   cin>>width;

   

   cout<<"Enter height: ";

   cin>>height;

   

   cout<<endl;

   ///////////////////////////////////////////

   int total_price = wallArea(length, width, height);

  cout<<"Total price: $"<<total_price;

   ///////////////////////////////////////////

   return 0;

}

You might be interested in
This graph shows the number of steps Ana and Curtis each took over the course of four days. Which of the following labels best d
Nataly [62]

Answer:

None of the above

Explanation:

5 0
3 years ago
Which of the following is a common financial aid scam that students sometimes find on the Internet? Grant and scholarship databa
allsm [11]

Which of the following is a common financial aid scam that students sometimes find on the internet?

All of the above.

6 0
4 years ago
Read 2 more answers
How to create a database table​
Triss [41]

Try and use this website to help:

https://www.oreilly.com/library/view/access-2013-the/9781449359447/ch01.html

5 0
4 years ago
Which grapgic element loads faster when used with text or audio
myrzilka [38]

Answer:

is there a multipule choice

Explanation:

7 0
3 years ago
The ability of a build system for handling a rise in the amount of code that it blends and analyzes is called ___________.
kari74 [83]

Answer:

Build integration

Explanation:

The ability of a build System to handle the rise in amount of code it blends/analyses is known as build integration.

It is the overall capacity of the build System to handle the growing amount of code. It is also a process where the system tries to handle potentials to accommodate growth. This is a very important condition.

6 0
3 years ago
Other questions:
  • Write a complete program that declares an integer variable, reads a value from the keyboard into that variable, and writes to st
    7·1 answer
  • The function below takes a single parameter number_list which is a list that can contain integers and floats. Complete the funct
    9·1 answer
  • Which is considered to be the oldest form of social media? A. media-sharing sites B. location-based services C. social networkin
    5·1 answer
  • Which hexadecimal number is equivalent to the decimal number 11?
    13·1 answer
  • Write a C++ program that computes an approximation of pi (the mathematical constant used in many trigonometric and calculus appl
    15·1 answer
  • III. FILL-IN THE BLANK (five points each)
    14·1 answer
  • What is a web browser​
    9·1 answer
  • In this for loop, identify the loop control variable, the initialization statement, loop condition, the update statement, and th
    7·1 answer
  • What are point to consider while running occupation?​
    15·2 answers
  • How many combinations of 1s and Os can we make with 6 place values?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!