There are several answers. Here is one:
LET X = BALLOON * 64
Since each balloon has a different number in
the variable BALLOON
, each balloon will have a
different X.
BALLOON | X | Y |
---|---|---|
1 | 64 | 100 |
2 | 128 | 100 |
3 | 192 | 100 |
4 | 256 | 100 |
... | ... | ... |
10 | 640 | 100 |
Here is the completed program
' Draw 10 Red Balloons SCREEN 12 ' start up graphics COLOR 4 ' set the pen color to red ' LET BALLOON = 1 ' start with balloon number 1 DO WHILE BALLOON <= 10 ' end with balloon number 10 LET X = BALLOON * 64 ' calculate an X for this balloon CIRCLE (X, 100), 25 ' draw a balloon LET BALLOON = BALLOON + 1 ' go on to next balloon LOOP ' END
Each balloon has a radius of 25. The balloons are drawn in a row with all their centers at Y=100. Each balloon is 64 pixels to the right of the previous one. The table shows this. The last balloon (number 10) has its center at (X=640, Y=100). This is the location of the right edge of the screen, so half the balloon is cut off.
Above is what the program draws on my system (reduced in size). To see the program's output in a window (as here), press ALT-ENTER when the program is showing the graphics screen. When you are done looking at graphics, press ALT-ENTER again.
Which half of the last circle (right or left) is cut off?