Menu

(Solved) : Exercise 4 Ve Volunteered Repaint Walls Leo S Lounge Need Use Ladder Painting Close Ceilin Q44091987 . . .

Exercise 4 Youve volunteered to repaint the walls in Leos Lounge and will need to use a ladder when painting close to the c

Exercise 4 You’ve volunteered to repaint the walls in Leo’s Lounge and will need to use a ladder when painting close to the ceiling. You know that a ladder has to be placed against a wall at an angle; otherwise, it will fall over. Use the FDR to design, code and test the definition of a function named height. This function takes the length of a ladder, measured in metres, and the angle that it forms with the ground as it leans against the wall, measured in degrees. It returns the height reached by the ladder. Your function definition: must have type annotations and a complete docstring. Think carefully about the range of permitted values for the two parameters. Remember to document these in your docstring. Hint 1:The most challenging part of this exercise is the math, not the Python code. In Step 1 of the FDR, use trigonometry to express the solution’s formula using mathematical notation before you prepare the function call examples. In Step 4 of the FDR, translating the formula to Python should be straightforward. Hint 2: When you’re coding the function body, use the shell to investigate which trigonometric functions are provided by Python’s math module: >>> import math >>> help(math) Show transcribed image text Exercise 4 You’ve volunteered to repaint the walls in Leo’s Lounge and will need to use a ladder when painting close to the ceiling. You know that a ladder has to be placed against a wall at an angle; otherwise, it will fall over. Use the FDR to design, code and test the definition of a function named height. This function takes the length of a ladder, measured in metres, and the angle that it forms with the ground as it leans against the wall, measured in degrees. It returns the height reached by the ladder. Your function definition: must have type annotations and a complete docstring. Think carefully about the range of permitted values for the two parameters. Remember to document these in your docstring. Hint 1:The most challenging part of this exercise is the math, not the Python code. In Step 1 of the FDR, use trigonometry to express the solution’s formula using mathematical notation before you prepare the function call examples. In Step 4 of the FDR, translating the formula to Python should be straightforward. Hint 2: When you’re coding the function body, use the shell to investigate which trigonometric functions are provided by Python’s math module: >>> import math >>> help(math)

Expert Answer


Answer to Exercise 4 You’ve volunteered to repaint the walls in Leo’s Lounge and will need to use a ladder when painting close to …

OR