Write a program which calculates the number of wallpaper rolls needed to decorate a room. Consider...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Follow the instructions below.This program provides a simplified example for selling tickets for three theaters within a movie house.In order to better reflect Object-Oriented principle, much of the...
-
Consider the generalized externality problem. Assume the damage and cost functions are given by: (a) Determine the non-regulated level of E if the polluter has the right to pollute. (b) Determine the...
-
A machine is purchased at the beginning of 2015 for $42,000. Its estimated life is eight years. Freight costs on the machine are $3,000. Installation costs are $1,600. The machine is estimated to...
-
You are arranging for housing for a woman who is in a homeless shelter. Her parents come to see you and ask you to see that she also goes to therapy. They tell you she has never seemed right, and...
-
Refer to the information in Exercise 17-1. Assume that the following information is available for the companys two products for the first quarter of 2017. Required Compute activity rates for each...
-
Accounting Change Ramirez Co. decides at the beginning of 2010 to adopt the FIFO method of inventory valuation. Ramirez had used the LIFO method for financial reporting since its inception on January...
-
Solve the linear programming problem by the method of corners. (There may be more than one correct answer.) C=5x+by Minimize subject to 4x + y 42 2x+ y 30 x+3y 2 30 x20, y 20 The minimum is C 52.5...
-
Apply the double Fourier transform to find the fundamental solution of the two-dimensional Helmholtz equation -Vu(x,y)+a?u(x,y)=f(x,y),-co
-
Checkpoint 2 - Advanced Caesar Cipher When encrypted, each letter in the message steps forward multiple letters in the alphabet (A encrypted by five becomes F). When decrypted, each letter in the...
-
Based on your own knowledge and experience, provide FIVE major considerations for choosing software tools to ensure accounting/bookkeeping compliance.
-
Explain what you think would happen if there was error in Mitosis?
-
A certain integrated circuit (IC) represented by the triangular symbol below has a maximum operating voltage of VIC = 5 V before damage is likely to occur. 04 R + 7.2 V+ R2 VIC Integrated Circuit -...
-
A horizontal frictionless table has a small hole in its center. Block A on the table is connected to block B hanging beneath by a string of negligible mass which passes through the hole. Initially, B...
-
The following molecule allows three rotation angles per bond (two bonds). Each bond rotation angle is independent and can exist in 3 states; high energy (2 kl/mol), middle energy (1 kJ/mol), and low...
-
Will the prediction interval always be wider than the estimation interval for the same value of the independent variable? Briefly explain.
-
Lorenzos is having a BoGoHo (Buy One, Get One Half Off) sale. The store manager wants an application that allows the salesclerk to enter the prices of two items. The half off should always be applied...
-
Which of the following calculates the average of the values in the OnHand field? a. SELECT AVERAGE(OnHand) AS Available FROM dbo.Inventory b. SELECT OnHand.AVG AS Available FROM dbo.Inventory c....
-
Identifying labels typically have their AutoSize property set to _____________________. a. Auto b. False c. NoSize d. True
-
Reconsider the data of Problem 31. Data from Problem 31 The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is...
-
The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is $20,000. Based on a future worth analysis, which...
-
Explain the relationship between the finite sample \(F\)-test and the large sample \(\chi^{2}\)-test, and the assumptions under which each is suitable.
Study smarter with the SolutionInn App