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
With examples write short notes on any of the following terms below.
stepladder [879]

types of computer viruses

1. polymorphic virus

2. worm

3.trojan horse

4.directory virus

5.boot virus

6.directory virus

7. macro virus

8. web scripting virus

9. memory resident virus

10. overwrite virus

11. direct action virus

12. multipartite virus

5 0
3 years ago
What is the correct flow of a computer system
Schach [20]

The use of the machine in the functions of the data process has necessitated an orderly flow of information. The sequence in which the operations were executed would have to be clearly defined, and when combined with the data to which it should be applied, that sequence will create the flow of information.

You can not put much emphasis on the documentation, the record of information. In the written instructions and without the graphic representation of the workflow serious, difficult to carry out a task of data procedure in an appropriate manner. There are several more efficient and organized methods, it is the Flow diagrams that the future programmer understands the necessity of the flowchart :) :) :) :v

4 0
3 years ago
What acronym is another name for static electricity, which can damage chips and destroy motherboards?
vlabodo [156]
Your answer is:
ESD

I hope this helps! :)
5 0
3 years ago
What is the purpose of an attribute in HTML
bearhunter [10]
Most of the HTML tags can also have attributes, which are extra bits of information
8 0
3 years ago
Read 2 more answers
Juan is an Information Technology expert who writes software that controls electronic components in cars and hardware that provi
Leviafan [203]
The answer is C as the man makes hardware that processes things faster and writes software that controls the electronics, in other words, he makes hardware and designs or architects a database to control the cars  
6 0
3 years ago
Read 2 more answers
Other questions:
  • What is the output of the following code? stackList stack; int x, y; x = 2; y = 3; stack.push(8); stack.push(x); stack.push(x +
    6·1 answer
  • . Constructors are executed when?
    10·1 answer
  • Microsoft words spell checker
    9·1 answer
  • Which of the following are parts of the Physical Layer?
    9·1 answer
  • (Count the occurrences of words in a text file) Rewrite Listing 21.9 to read the text from a text file. The text file is passed
    10·1 answer
  • Randy is concerned about his company’s data security on the Internet. Because cellular signals are not encrypted, he is concerne
    8·1 answer
  • What does a wireless LAN (WLAN) act as to a wired network?
    12·1 answer
  • Which tools do meteorologists use to collect data about the weather?
    13·2 answers
  • A class researching the world’s population would like to include a graph that shows historical changes. They have information fr
    7·1 answer
  • reagan's firm has not had to make large investments in computer or networking hardware or in personnel to maintain the hardware
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!