Question: Question 11A (8 points) A stair (like the one we use to go from floor to floor) consists of two parts: a tread and a

 Question 11A (8 points) A stair (like the one we use

Question 11A (8 points) A stair (like the one we use to go from floor to floor) consists of two parts: a tread and a riser. Write a function named stair that uses turtle graphics to draw a stair of specified size The function stair takes three parameters: 1. t, a tutle that is used to draw the stair. The parameter t may be in any position on the screen, orientation and either up or down. 2. tread_size, a positive integer 3. riser_height, a positive integer The function stair should: 1. draw the stair tread and then the riser, in that order, with a 90 degree angle between them 2. leave t positioned at the end of the riser when it returns 3. leave t in its initial orientation when it returns (Hint: this position and orientation leave the turtle ready to draw another stair) For example the following would be correct graphical output import turtle s turtle.screen() t turtle.Turtle() stair(t, 100, 50) Question 11B (12 points) Write a function named staircase that uses the stair function of Question 11A to draw a connected set of stairs. The function staircase takes four parameters: 1. turt, a turtle that is used to draw 2. num stairs, an integer that is the number of stairs in the staircase 3. tread_size, a positive integer 4. riser_height, a positive intege The function staircase should leave turt in its initial orientation, positioned at the end of the riser of the last stair. For example, the function cal staircase (aTurt, 3, 100, 50) should produce the following graphical output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!