Lab 9 Algorithm

  1. Display Greeting
  2. Initialize sum and count to 0
  3. Get first integer, number
  4. Initialize min and max to first integer, number
  5. Repeat step 6 through 10 while number is not 0
  6. Add number to sum
  7. Increment count
  8. If number is greater than max, update max to number
  9. If number is less than min, update min to number
  10. Get another integer, number
  11. Calculate average as sum divided by count
  12. Calculate range as max minus min
  13. Display count, min, max, range, and average
  14. Ask if user wants to continue
  15. Repeat steps 2 through 14 if response is affirmative