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 90-width and 10-height rectangle is the first one you draw. You should only need one loop and it must count down from 90 to 10.
Hints:
Start by writing a loop that just prints out the values 90,80,70,...,10. These will be the widths of the rectangles you end up drawing.
Next, for each width, calculate the corresponding height. Each width/height pair should always add to 100, so if we call the width ,w, the height must be .100w. Print out the height with the width so that your output looks like 9010,8020,7030,...,1090.
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 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 Programming Questions!