Answer:

The answer is given below.

Next Three Steps

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.

  1. Program picks a random number which will be how many spots to draw.
  2. Program drawns that many spots.
  3. Program asks the user how many spots there are.
  4. User types in an estimate.
  5. Program reads user's estimate.
  6. Program calculates error, and writes result.

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.

QUESTION 22:

Fill in the blanks so the program works as described.