Your instructor may assign you one of the problems below. To solve your problem, write a program that reads the necessary information to compute and output the indicated values, as efficiently as possible.

Project #10.1: Themedianvalue of a sequence of numbers is a valuevsuch that one half of the numbers are greater thanv, and one half of the numbers are less thanv. A simple algorithm to compute the median of a sequence isWrite a function that, given a vector of numbers, computes the median value of those numbers. Your function should use the STL

- Let
be the sequence.`seq`

- Let
be the number of values in the sequence.`n`

- Sort
.`seq`

- If
is an odd number:`n`

Return the middle value of the sorted sequence.

Otherwise (is even):`n`

Return the average of the two middle values in the sorted sequence.`sort()`

algorithm for the third step. Write a program that, given the name of a file containing an arbitrary sequence of numbers, computes and displays the median value of that sequence.

Project #10.2: A certain on-line testing program records student exam results in a text file, each line of which has the form:Write a program that analyzes student performance on an exam using the information from such a file (although you should store the data in

name

examScore`vector`

s). The program should input the name of the text file, and then display the worst score, the best score, the average score, the standard deviation, and ahistogram---a bar graph indicating the frequency with which a given score occurred. For example, if three people scored 74, five people scored 75, six people scored 76, no one scored 77 and two people scored 78, then that portion of the histogram should appear as:74: *** 75: ***** 76: ****** 77: 78: **

Project #10.3: Each year a meteorologist creates a file containing a 12 monthly precipitation totals. Write a program that, given the names of two of these files, will create a file containing an easy-to-read analysis comparing the two sets of readings, including which of the two years was the wettest (and by how much), the average monthly precipitation for each year, and the wettest and driest months in each year.

Project #10.4: Write a program that, given the name of a text file, reads that file and counts the number of occurrences of each letter of the alphabet. Your program should use a`vector`

of length 26 to count the occurrences of the 26 alphabetic letters and treat upper and lower-case instances of a letter as the same letter. (Hint #1: look up`tolower()`

— testing the case isn't necessary. Hint #2: if`ch`

is a`char`

, then`ch − 'a'`

is a valid C++ expression and will evaluate to 0 when`ch`

is equal to`'a'`

.)Run your program on several large text files.

Report errors to Larry Nyhoff (nyhl@cs.calvin.edu)