CSE 109 Programming Assignment 3 Due 10:45 PM Thursday 15 March 2012 (Late submissions due 10:45 PM 17 March and 18 March) This assignment is an exercise in writing a subclass. I ask you to write a subclass, Stat, of the class Frequency that you developed for p0. The subclass Stat performs various statistical calculations on the data from the frequency distribution stored by the superclass Frequency. Instances of Stat respond to the method mean() by either returning the harmonic mean or by returning the arithmetic mean, depending on an internal flag. For the data x1, x2, ..., xn, the arithmetic mean is (x1 + x2 +...+xn)/n, while the harmonic mean is n/(1/x1 + 1/x2 + ... + 1/xn). For the data 1 2 3, the arithmetic mean is (1+2+3)/3=2, and the harmonic mean is 3/(1/1 + 1/2 + 1/3) = 18/11. The variance of the data x1, x2, ... xn, with mean X, is ( (x1-X)*(x1-X) + (x2-X)*(x2-X) +...(xn-X)*(xn-X) )/n. The standard deviation of the data is sqrt(variance). Basically, the class Stat should be able to return the type of mean it calculates, the mean itself, the variance, and the standard deviation. It should also be able to create a new instance of Stat by adding (combining) two instances of Stat. Each class declaration and each set of class definitions should be stored in separate .h and .cc files. The file p3.cc should have a main() that uses class Stat. You should create a Makefile that compiles each class and p3.cc separately. I have stored a sample program for testing out your class Stat in /proj/csc109/p3/p3.cc. I will test your class Stat by replacing your p3.cc with /proj/csc109/p3/p3.cc and calling "make." I may also test your class with other versions of p3.cc. The comment at the bottom of p3.cc gives the output when my classes Frequency and Stat are used. If your version of class Frequency does not function well, you can use mine. My versions of frequency.h and frequency.o are stored in the directory /proj/csc109/p3. To use them, in your Makefile omit the target frequency.o, add the line cp /proj/csc109/p3/frequency.o frequency.o to the target "clean:"