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]
2 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]2 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
A technician wants to limit access to a group of folders and is using Group Policy to prevent the users in the sales department
Mashcka [7]

Answer:

d. The technician should be setting NTFS permissions instead of using Group Policy.

Explanation:

NTFS (New Technology File System) permissions run on drives formatted with NTFS.Under NTFS permissions, individual users are granted permission at the Windows logon and so in this way local users and network users are affected, affecting each user from wherever he may be connecting from. In the example above using NTFS permissions would solve the problem of file system among departments .

4 0
2 years ago
Ling has configured a delegate for her calendar and would like to ensure that the delegate is aware of their permissions. Which
const2013 [10]

Answer:

Tasks>Editor (B)

Explanation:

I just did the test

4 0
3 years ago
Read 2 more answers
Explain how can you protect your computer from malware
rosijanka [135]
Trend micro security for your Mac or pc or trend micro mobil security for your android or iOS Mobil device?

Hope this helps!
6 0
3 years ago
Read 2 more answers
Which tab automatically becomes available after inserting a text box? Drawing Tools Insert Text Box Tools Shape Tools
In-s [12.5K]

Answer:

insert text box

Explanation:

6 0
3 years ago
Read 2 more answers
I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
rjkz [21]

Answer:

Explanation:

The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter a number of type double to calculate square root:");

       double num = in.nextDouble();

       rootPositive(num);

   }

   public static void rootPositive(double num) {

       if (num > 0) {

           System.out.println(Math.sqrt(num));

       } else {

           System.out.println("Number must not be negative.");

       }

   }

}

5 0
3 years ago
Other questions:
  • Harry needs to use a type of graph in a spreadsheet to show variations in data over a specific period. What type of graph or cha
    11·2 answers
  • Hardy doesn't have access to a work template, which is on the network server. What should he do?
    14·1 answer
  • What are the benefits of organizing your thoughts before you begin your speech
    14·1 answer
  • on average, someone with a bachelor’s degree is estimated to earn _______ times more than someone with a high school diploma
    13·1 answer
  • An is auditor reviewing a network log discovers that an employee ran elevated commands on his/her pc by invoking the task schedu
    10·1 answer
  • (Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate
    10·1 answer
  • How to make changes to a file on the USB drive
    6·2 answers
  • What is the model for 2017 Ford Mustang v6
    15·1 answer
  • Are there any apps in the App Store that allow people to ask a question about any topic and have skilled professionals answer it
    6·1 answer
  • The 0-1 knapsack problem is the following. A thief robbing a store finds n items. The ith item is worth vi dollars and weighs wi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!