Tom Kelliher, CS17

Mar. 15, 1996

If you finish the first program, move on to the second. Hand-in a listing of the first program.

  1. Write a program which interactively reads test scores until a score of zero (sentinel value) is entered. Compute and output the average of the input scores. The sentinel value is not included in the average (sentinel values are never included with the input). Hint: keep a running total of the input scores and a count of the number of input scores read so far.

  2. Write a program which uses a while loop to determine the number of digits in an input integer by repeatedly removing the least significant digit (using one of the common arithmetic operators) until the number becomes zero.

Thomas P. Kelliher
Thu Mar 14 11:04:23 EST 1996
Tom Kelliher