Simulation, Modeling, and Monte Carlo Methods in Archaeology

Keith Kintigh

Problem Set 3 - Sample Mean and Standard Deviation - Due February 6

Write a Java program that will read an arbitrary number of positive values from the keyboard an compute their mean and a sample standard deviation. The program should prompt for a new value and stop if you enter a 0 or a negative value, and then write the mean and standard deviation to the screen. Use the method SavitchIn.readLineDouble() to get the values. Put comments in the program to document what you have done. To calculate the standard deviation, you need to calculate a square root. The method for that can be accessed as Math.sqrt().

Test this program yourself and email me a copy of the Java code.