INFO-1156 project answers
Project Description
Create a C17 console application to compile the following statistics on a list of real numbers:
- Number of values
- minimum value;
- maximum value;
- median value;
- arithmetic mean;
- mean absolute deviation – (mean, median, mode)
- variance (of a discrete random variable);
- standard deviation (of a finite population);
- mode (including multi-modal lists).
- least squares regression line
- outliers
Your program must handle any length of list. The list will be input (or piped) from the console, or read from a file. The list is terminated with end-of-stream (^Z, or ^D on Linux) or non-numeric input. A sample input list is posted on FOL.
Keep the output clean and minimal. A sample output file is posted on FOL.
You are to implement your own sort (it must sort two arrays in parallel, or an array of structures). Your grade is dependent upon the sorting algorithm that you choose (to get full marks, implement the quick, merge sort or heap sort). Sorting algorithms can be found at GATS Companion to Searching and Sorting.
A sample of the executable, input file format and output file format are posted on FOL. Your output should be formatted as the output file. All statistics numbers calculated should be displayed to 3 decimal places, where applicable. You should create more input files to verify that all your statistics are done properly.
Least Squares Formulae
= �� 2� − ̅2
=1
= �� � − ̅�
=1
Where b is the slope, and a is the y-intercept.
= � − ̅
Outliers
Outliers are values that are a significant distance from the mean. When the absolute difference between a sample and its mean exceeds the standard deviation, it is a 1x outlier. Make a list of 2x and 3x outliers – considering the values, the mean, and the standard deviation.
Note!
- Note that both the modes and the outliers can have multiple
- A data set with all values occurring the same number of times has no mode!
Examples:
Grading Criteria
- Input Requirements
- Reads double precision real numbers
- Terminates input on EOF
- Doesn't handle any size data set (array is NOT heap allocated)
- Skips bad inputs (only terminates on 'end' or EOF)
- Input from keyboard
- Input from file named on command line
- Reports bad filename
- Statistics Requirements
- Number of values reported
- Minimum value correctly reported in all cases
- Maximum value correctly reported in all cases
- Mean correctly reported in all cases
- Median correctly reported in all cases
- Variance correctly reported in all cases
- Standard deviation correctly reported in all cases
Mode: reports number of occurrences | 1 | 1 | 3% | ||||||
Mode: Unique mode correctly reported in all cases | 4% | 1 | 1 | 4% | |||||
Mode: Multi-mode correctly reported in all cases | 4% | 1 | 1 | 4% | |||||
Mode: No-mode correctly reported in all cases | 2% | 1 | 1 | 2% | |||||
Mean absolute distribution about mean | 4% | 1 | 1 | 4% | |||||
Mean absolute distribution about median | 2% | 1 | 1 | 2% | |||||
Mean absolute distribution about mode (if unimodal) | 1% | 1 | 1 | 1% | |||||
Regression Line: slope | 5% | 1 | 1 | 5% | |||||
Regression Line: intercept | 5% | 1 | 1 | 5% | |||||
Outliers: reports no outliers | 2% | 1 | 1 | 2% | |||||
Outliers: reports number of outliers | 2% | 1 | 1 | 2% | |||||
Outliers: reports 2x outliers | 3% | 1 | 1 | 3% | |||||
Outliers: reports 3x outliers | 3% | 1 | 1 | 3% | |||||
Sort is: bubble |
0% |
1 |
0% | ||||||
Sort is: insertion sort |
5% |
1 |
0% | ||||||
Sort is: <stdlib.h> qsort |
2% |
1 |
0% | ||||||
Sort is: quick/merge/heap |
10% |
1 |
1 |
10% | |||||
Sort is: Bogo/Bozo |
-5000% |
1 |
0% | ||||||
Labels are not left justified |
-5% |
1 |
0% | ||||||
Values are not right justified |
-5% |
1 |
0% | ||||||
Values are not rounded to 3 decimal places |
-5% |
1 |
0% | ||||||
Frequency table code is contained in a function |
3% |
1 |
1 |
3% | |||||
Multi-file solution |
5% |
1 |
1 |
5% | |||||
Penalties from C & C++ Grading Guide v2.3.0 |
-5% |
1 |
0 |
0% | |||||
Late submission: |
-10% |
1 |
0 |
0% | |||||
Total |
100% |
Submission Requirements
- Submit entire Visual Studio project directory to Fanshawe Online
- Delete all debug and release i
- Submit in a .ZIP, .7z archive
i Alternatively, you can ‘clean’ your project for submission by downloading ‘vsclean’ a Visual Studio Solution Cleaner from gats.ca