Write a QBasic statement that picks a random integer from 0 to 29,999.

Answer:

LET NUMBER = INT( 30000*RND )    ' pick a random number 0 to 29,999

First Two Steps of the Program

Remember the first two steps of the program:

  1. Program picks a random number.
  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 the user's estimate.
  6. Program calculates the error, and prints it.

Fill in the blanks of the following program so that it does those two steps:

LET NUMBER = _______________________
'
SCREEN 12
FOR DOT = 1 to ________
  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

QUESTION 21:

Fill in the two blanks.