Question: elow is a program with rectangle already defined. Add code that uses a for loop to call the procedure with the correct values for its
elow is a program with rectangle already defined. Add code that uses a for loop to call the procedure with the correct values for its parameters. Make sure that the width and height rectangle is the first one you draw. You should only need one loop and it must count down from to
Hints:
Start by writing a loop that just prints out the values These will be the widths of the rectangles you end up drawing.
Next, for each width, calculate the corresponding height. Each widthheight pair should always add to so if we call the width w the height must be w Print out the height with the width so that your output looks like
Finally, call rectangle in your loop and pass it the width and height you are calculating.
The autograder will not verify everything about your program. It is up to you to determine if your program is correct or not.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
