Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON (simple functions and import math) In this exercise you will compute the number of gallons of paints needed to paint a room. Your computation

PYTHON (simple functions and import math)

In this exercise you will compute the number of gallons of paints needed to paint a room. Your computation will assume that the room is rectangular and you will not take into account openings such as doors and windows.

In questions (1) and (2), write the definitions for functions that meet the indicated specifications. Those function are used in the main progam. In question (3) you will be asked to complete the main program.

(1) Function to compute the wall area given room dimensions.

wall_area(width, length, height) width, length, height are respectively the width, length and height (in feet) of a rectangular room. Returns the area of the walls surface.

wall_area(12, 16.5, 9.25) will return 527.25

(2) Function to compute the amount of paint needed given the area and paint coverage.

gallons_paint(area,sqft_per_gallon) area is area to be painted, sqft_per_gallon is how many square feet a gallon of paint covers. Returns the number of gallons needed to paint a room with given area. The number of gallons needed must be an integer.

gallons_paint(527.25,350) will return 2.

(3) A function get_dimension() has been defined. The function purpose is to allow the user to input one dimension of the room. The paramater will indicate which dimension the user is prompted for. For example, if get_dimension('height') is called, the user will be prompted for the height. Use calls to get_dimension() to get the user input for height, length, and width of the room. Add code where indicated in the template. You must use the indicated variables and you must request the dimension in the given order so your program can pass the tests.

Do not change code after the line #DO NOT MODIFY CODE BELOW

If the input is

9 3 16 6 12 0 350 

The output will end with

Area: 527.25 square feet Gallons of paint needed: 2 gallon(s) 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

4. What will the team agreement contain?

Answered: 1 week ago