Focus on function arguments, return values, modules 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. Color Green Cost/can $3.68 The available colors and their cost per can are: Red $4.25 Custom $6.00 Blue Eggshell $4.25 White $3.69 $3.25 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 dimension 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. length width height 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.
Focus on function arguments, return values, modules 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. Color Green Cost/can $3.68 The available colors and their cost per can are: Red $4.25 Custom $6.00 Blue Eggshell $4.25 White $3.69 $3.25 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 dimension 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. length width height 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.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY