Cover page images (keyboard)

Lab 10 - Data Types

Sue Evans



Press space bar for next screen

Objectives












Step 0 - Set up












Exam Data

Step 1 - Design













Step 2 - main() & stubs

Write the top-level functions

Testing Time












Step 3 - readFile()

Write readFile(filename)

Testing Time













Step 4 - findMean()

Step 5 - complete main()












Bonus Step - Median

Find the median of the scores. From Wikipedia:

In statistics, a median is described as the number separating the higher half of a sample from the lower half. The median of a list of numbers can be found by arranging all the numbers from lowest value to highest value and picking the middle one.

If the total count of numbers in the list is odd, the median is unique and is the middle value. If the total count of numbers in the list is even the median is not unique and is frequently taken as the average (mean) of the two middle values.

Challenge Step - Standard Deviation

Find the standard deviation of the scores.

The standard deviation is a measure of how spread out the data is relative to the mean. If the data is tightly clustered around the mean then the standard deviation is small. When the data is more spread out, the standard deviation is large.

Write a function findStdDev() that calculates the standard deviation of the scores. Here's the formula:

where bar x represents the mean,
x i represents the ith data value,
and n is the number of data values.

Sigma means the sum of whatever follows it.