The answer is given below.
Here is the program with the first two steps finished:
LET NUMBER = INT( 30000*RND ) ' pick a random number 0 to 29,999 ' SCREEN 12 FOR DOT = 1 to NUMBER LET X = INT( 640*RND ) ' pick a random column 0 to 639 LET Y = INT( 480*RND ) ' pick a random row 0 to 479 PSET( X, Y) ' draw the random point NEXT DOT ' END
The biggest problem in getting the answer
is remembering that a variable
like NUMBER
can be used as
the upper limit for the FOR
loop.
Now look at the next three steps. One of the three is something that the user does (typing in an estimate), so the program has to do only two new things.
Here is the program with blanks for the new things it has to do:
LET NUMBER = INT( 30000*RND ) ' pick a random number 0 to 29,999 ' SCREEN 12 FOR DOT = 1 to NUMBER LET X = INT( 640*RND ) ' pick a random column 0 to 639 LET Y = INT( 480*RND ) ' pick a random row 0 to 479 PSET( X, Y) ' draw the random point NEXT DOT ' PRINT ____________________ READ ____________________ ' END
Prompt the user about what to do.
Put the user's estimate into a variable called GUESS
.
Fill in the blanks so the program works as described.