Using python and develop the program. The FiveTwelve Construction Company has asked you to implement a computer program to determine the number of cans of paint, along with the cost, to paint a room of a given size with a given color. You will write this program using a main() and several functions. The functions will be organized into two modules. The available colors and their cost per can are: Color Green Red Blue Eggshell White Custom Cost/Can $3.68 $4.25 $3.69 $4.25 $3.25 $6.00 get_dimension: This function will prompt the user for a room dimension value as input and return it. The function should be passed one argument, a string which identifies which diemension is to be entered  (‘length’, ‘width’, ‘height’). The function should perform basic input validation before returning the value. The dimensions width and  length will be between 4.5 and 30 feet, height between 6.5 and 16 feet. Notice that the function will be called three times by main(), once for each dimension. get_color: This function will prompt the user for the color to be used and return the value. The color should be limited to one of the available ones. While the user should be  presented with the names of the colors, they should be shown along with abbreviations that are easier to enter, for example Green (G), Red (R), etc. The abbreviations will be the coded value that the function returns. calc_cans: This function should compute and return the number of cans of paint needed for the job. The three dimensions will be passed as arguments and the function will calculate the total surface are to be painted and then the number of cans required. The returned value must be an integer, since the company can’t buy fractional cans of paint. Also, you cannot  just convert from float to int because that will always truncate the quantity. Use the math.ceil function.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Using python and develop the program. The FiveTwelve Construction Company has asked you to implement a computer program to determine the number of cans of paint, along with the cost, to paint a room of a given size with a given color. You will write this program using a main() and several functions. The functions will be organized into two modules. The available colors and their cost per can are:

Color Green Red Blue Eggshell White Custom
Cost/Can $3.68 $4.25 $3.69 $4.25 $3.25 $6.00

get_dimension: This function will prompt the user for a room dimension value as input and return it. The function should be passed one argument, a string which identifies which diemension is to be entered  (‘length’, ‘width’, ‘height’). The function should perform basic input validation before returning the value. The dimensions width and 
length will be between 4.5 and 30 feet, height between 6.5 and 16 feet. Notice that the function will be called three times by main(), once for each dimension. get_color: This function will prompt the user for the color to be used and return the value. The color should be limited to one of the available ones. While the user should be 
presented with the names of the colors, they should be shown along with abbreviations that are easier to enter, for example Green (G), Red (R), etc. The abbreviations will be the coded value that the function returns. calc_cans: This function should compute and return the number of cans of paint needed for the job. The three dimensions will be passed as arguments and the function will calculate the total surface are to be painted and then the number of cans required. The returned value must be an integer, since the company can’t buy fractional cans of paint. Also, you cannot  just convert from float to int because that will always truncate the quantity. Use the math.ceil function.

The room has 4 walls and a ceiling to paint and is rectangular. The floor will not be painted. Two walls will have size height*length and two will have height*width. The ceiling’s size is length*width. One can of paint covers 365 square feet of surface. 

calc_cost: This function should compute and return the total cost of paint for the room. It will receive the number of cans of paint and the color code (abbreviation) as arguments.

main(): will call the functions and print out the final cost for the user.

The first two functions should be stored in a module named fetch.py.
The third and fourth functions should be stored in a module named compute.py.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education