CS 1500: Project 5 -- Statistics

Due Friday, Dec. 14, 5:00 pm

 

For this project, you will develop a Java program that will read a file of numbers, and do some elementary statistical calculations.

Your program should prompt the user for a filename, read data from the file, and use java methods to do the calculations.
See the sample program interaction below . . .

Submission: We will be using the CS Homework Submission system

( https://hopper.csustan.edu/cshomework/ ).

You will submit your ".java" file, as usual . . .

Input data: Your program will read a filename from the user, then read data from the file.

The format of the file will consist of ascii (text) numbers. The first number will specify how many (data) numbers follow.

Example data file:

		20
		1.1 2 3.3 4 5.5 6 7 8.5 9 10.0
		11 12.3 13 14 15.5 16.1 17 18 19.2 20.0
	

Output: Your program will perform the appropriate calculations (see below).

Scoring: The maximum possible score for the project will be 80 points. There will be up to 40 points for correct operation of your program, and up to 40 points for style, comments, etc.

Late programs will have their maximum possible score reduced to 0.9 times previous for each calendar day late (i.e., maximum possible score = 80 * (0.9^n) for n days late . . .).


Examples:
First example:
	Current folder: /Users/tom/Classwork/F12/CS1500/NetBeans/Stats

	Java will look there for the file name you enter,
	     unless you enter the full path . . .

	Enter file name (default is /Users/tom/data/numbers-example.txt): 

	The file /Users/tom/data/numbers-example.txt has 20 numbers in it

	The numbers are:

	1.1 2.0 3.3 4.0 5.5 6.0 7.0 8.5 9.0 10.0 
	11.0 12.3 13.0 14.0 15.5 16.1 17.0 18.0 19.2 20.0 

	The mean is 10.625
	The standard deviation is 5.750

	Thanks!
	
Second example:
	
	Current folder: /Users/tom/Classwork/F12/CS1500/NetBeans/Stats

	Java will look there for the file name you enter,
	     unless you enter the full path . . .

	Enter file name (default is /Users/tom/data/numbers-example.txt): numbers-example-150.dat

	The file numbers-example-150.dat has 150 numbers in it

	The numbers are:

	103.55 82.81 93.23 93.54 78.07 104.03 118.22 108.7 98.19 110.08 
	126.75 107.44 85.42 112.99 105.48 77.25 110.56 89.75 67.74 126.07 
	87.01 102.6 105.75 105.61 108.91 94.31 100.17 126.93 105.54 99.44 
	92.75 85.51 114.77 93.32 121.71 105.51 98.45 95.79 100.4 94.4 
	91.76 97.55 132.06 119.32 100.02 100.69 108.15 95.89 92.75 97.29 
	115.92 97.84 89.42 83.21 114.61 99.31 123.01 77.69 93.78 115.87 
	85.35 89.3 111.42 118.29 93.58 129.49 102.71 111.57 84.94 89.03 
	104.85 69.06 71.69 100.45 105.12 78.64 96.31 100.29 94.37 114.43 
	98.32 107.39 94.2 76.82 103.1 122.22 96.41 124.18 116.45 92.44 
	100.36 80.24 86.85 75.89 106.33 113.76 80.96 78.25 141.05 111.56 
	93.94 87.72 82.24 81.34 119.94 99.97 106.31 86.98 110.41 93.64 
	96.16 101.54 92.16 95.72 76.8 102.35 84.14 113.76 94.09 95.55 
	95.76 126.67 70.28 79.27 66.55 107.47 111.57 109.74 91.28 86.76 
	109.35 111.37 113.42 110.13 105.85 99.35 104.82 111.24 94.13 104.94 
	102.26 87.13 111.15 114.95 63.68 120.96 76.17 117.53 108.69 95.57 

	The mean is 99.769
	The standard deviation is 14.663

	Thanks!


Third example:
	
	
	Current folder: /Users/tom/Classwork/F12/CS1500/NetBeans/Stats

	Java will look there for the file name you enter,
	     unless you enter the full path . . .

	Enter file name (default is /Users/tom/data/numbers-example.txt): /Users/tom/Classwork/F12/CS1500/NetBeans/Stats/numbers-example-30.dat

	The file /Users/tom/Classwork/F12/CS1500/NetBeans/Stats/numbers-example-30.dat has 30 numbers in it

	The numbers are:

	106.45 90.47 99.99 98.91 80.06 92.09 95.13 111.35 104.08 119.42 
	121.78 112.81 123.2 100.56 121.67 81.7 118.18 97.63 79.89 120.72 
	115.1 89.78 87.11 92.53 104.47 105.18 97.43 108.12 97.78 112.3 

	The mean is 102.863
	The standard deviation is 12.748

	Thanks!