Computer Science 145.002
Introduction to Computing for Engineers
Fall 2008 / Programming Assignment 9
“Strings, Dynamic Arrays, Output, and Statistics”
Due: 7:30 AM, Tuesday, December 2, 2008

Technical advances is manufacturing engineering, such as ultra high-speed machining, have substantially reduced the time necessary to fabricate tools and parts, but the bottleneck in production has consequently moved to inspection. Before manufactured products can be released to industrial consumers, they must be inspected for accuracy.

In this programming assignment, you will write a program that examines numerous readouts for fabricated spheres. These readouts represent various surface coordinates on an individual sphere, which has been centered at the origin. By taking certain statistical measurements regarding the radius of each sphere, as measured from each of these surface points, a table of results will be produced, enabling the manufacturer to ascertain whether the production process is yielding consistently precise results.

Each file contains measurements from a single fabricated sphere, and each file prefix is unique to a single fabrication process. Thus, files ballbearing001.txt through ballbearing050.txt might pertain to fifty different ball bearings that were produced in one factory, while solder001.txt through solder275.txt could pertain to 275 different solder spheres manufactured at another location. The user will specify the prefix (e.g., “ballbearing”, “solder”) for the files in question, and your program will determine how many files with that prefix exist and then process all of the data from those files. You may assume that the prefixed file names will always be followed by three numerals, that the numbering will start at 001, and that the files will be numbered consecutively.

For each file in a particular set, your program will calculate and output three statistical values:

·  The mean of the radius values associated will the coordinate triples in the file, i.e.,

r=1ni=1nri

·  The standard deviation of the radius values, i.e.,

σ=1ni=1nri-r2

·  The kurtosis of the radius values, i.e.,

γ=1ni=1nri-r41ni=1nri-r22-3

The mean indicates the average radius value for all values in each file; the standard deviation indicates the extent to which particular radius values in the file deviated from the mean, and the kurtosis indicates whether the variations were due to occasional extreme deviations (i.e., positive kurtosis) or due to frequent deviations that were modest in size (i.e., negative kurtosis). An example session of the completed program is illustrated at right.

Name your project PA9_Lastname where Lastname is your last name (e.g., Tom Turkey’s project would be PA9_Turkey). A zipped folder containing input files consisting of several data sets is available on the course Web page at http://www.cs.siue.edu/wwhite/CS145/Syllabus.htm.Be sure to include adequate explanatory comments in your code.

Zip-compress the entire project folder and place the zipped folder on your Moodle dropbox by 7:30 AM on Tuesday, December 2, 2008.