Statistics Download

Dave Wittry

ints, basic math Student approved


Introduction

  1. You'll receive a text file, numbers.txt, that contains many integers ranging in value from 0 to 100. The text file has been created with each value separated by at least one space.
  2. The number of integers in the file is unknown. You must read the text file until it ends.
  3. Your program must find the average, standard deviation, and mode of the list of numbers.


Task

Your program should print out the average, standard deviation, and mode(s) of the data in numbers.txt. Format the real numbers to print with 2 decimal places. Clearly label all output.


Starter code

class Statistics{
	
}

Expected output

Given the numbers 7 4 5 9 10:

- Average: 7
- Sum of square of differences: (7 - 7)2 + (4 - 7)2 + (5 - 7)2 + (9 - 7)2 + (10 - 7) = 0 + 9 + 4 + 4 + 9 = 26
- Division by sum less one: 26/(5-1) = 6.50
- Square root: Square root(6.50) = 2.55

Useful tools to solve the problem