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!

  1. Note that both the modes and the outliers can have multiple
  2. A data set with all values occurring the same number of times has no mode!

Examples:

INFO-1156 project example 1 INFO-1156 project example 2

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 occurrences113%
Mode: Unique mode correctly reported in all cases4%114%
Mode: Multi-mode correctly reported in all cases4%114%
Mode: No-mode correctly reported in all cases2%112%
Mean absolute distribution about mean4%114%
Mean absolute distribution about median2%112%
Mean absolute distribution about mode (if unimodal)1%111%
Regression Line: slope5%115%
Regression Line: intercept5%115%
Outliers: reports no outliers2%112%
Outliers: reports number of outliers2%112%
Outliers: reports 2x outliers3%113%
Outliers: reports 3x outliers3%113%

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

  1. Submit entire Visual Studio project directory to Fanshawe Online
    1. Delete all debug and release i
    2. 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

Want Answer for this Assessment