Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program which calculates the number of wallpaper rolls needed to decorate a room. Consider that scraps are not used (e.g., if a
Write a program which calculates the number of wallpaper rolls needed to decorate a room. Consider that scraps are not used (e.g., if a wallpaper roll is 10m long and you need strips 3m long, you get 3 strips per roll, and the 1m left is not used). Wallpaper strips are placed horizontally on the wall, as illustrated in the following figure: wall width or length wall height wallpaper width The following information is known: the length and width of one wallpaper roll, and the length, width and height of the room. Your program should calculate the following intermediate values: the number of strips per roll, given the room's height and the length of the wallpaper, the room perimeter, given the room's width and length, the total number of strips needed to cover the full room, given the room perimeter and the wallpaper width, the total number of rolls, given the total number of strips and the number of strips per roll. Running this program with the following initial values: width_wallpaper_roll = 0.53 length_wallpaper_roll = 10.05 length room = 4 width room = 3 height room 2.1 would result in the following output: The total number of wallpaper rolls needed for this room is 7. Please note the following: You can assume that the math module has been imported and you do not need to include the import statement in your answer. You will need to use the math.ceil() function and the // operator in your program. Do not include the above variable initialization statements in your code. They will be provided for you with each CodeRunner test case. It is recommended that you calculate the result by hand with the values given in example before you start coding. This will give you a better idea of what the calculations should be. For example: Test width wallpaper_roll = 0.53 length_wallpaper_roll = 10.05 length room 4 width room 3 height room 2.1 width wallpaper_roll = 0.5 length_wallpaper_roll =15 length room 10 width room 5 height room = 3 Result The total number of wallpaper rolls needed for this room is 7. The total number of wallpaper rolls needed for this room is 12.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started