Answer:

Story Problem

Here is a more sophisticated version of the average rainfall problem:

Write a program that computes the average rainfall for any number of days.

  1. The user first says how many days are to be averaged.
  2. The user then enters the rainfall in inches for each day, one by one.
  3. The program computes the average and writes it out.

Here is the program, with some blue blanks:

' Create the array
PRINT "How many days to average?"
INPUT NUM
DIM RAIN( 1 TO _________ )

' Collect each day's rainfall
FOR COUNT = 1 TO _________
  PRINT "Input rain for day number "; _________
  INPUT RAIN( __________ )
NEXT COUNT

' Add up the rainfall for each day
LET SUM = 0.0
FOR COUNT = 1 TO _________
  LET SUM = SUM + RAIN( ________ )
NEXT COUNT

' Compute and print the average
LET AVERAGE = SUM / ___________
PRINT "The average rainfall is: "; AVERAGE

END

QUESTION 10:

Well, of course: Fill in the blanks.

Too many blanks? Click here for a .