CS 111 - 2/7/17 Exam 1: Thursday, 2/16/17, during lecture 20 Multiple Choice Questions 2 Write Code Questions Earn 1% toward final letter grade by writing a possible exam question in Blackboard Forum Algorithm Composition: (steps to create some code) Create a function to draw a rectangle which can have its length and width specified 1. Determine what parameters are needed one parameter to specify the turtle one parameter to specify the height of the rect one parameter to specify the width of the rect 2. What (if any) return value is given No return value 3. Steps needed to perform the desired outcome Attempt 1: draw four sides Refinement 1: draw side using the height parameter turn by 90 degrees draw side using the width parameter turn by 90 degrees draw side using the height parameter turn by 90 degrees draw side using the width parameter turn by 90 degrees Refinement 2: repeat the following twice in a loop: draw side using the height parameter turn by 90 degrees draw side using the width parameter turn by 90 degrees Write in code: def drawRect( turtle, hgt, wid ) : count = 1 while ( count <= 2 ) : forward (turtle , hgt) turn ( turtle, 90 ) forward (turtle , wid ) turn ( turtle, 90 ) count = count + 1