finalreport4 - Benjamin Jones 31 January 2008 Final Report...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Benjamin Jones 31 January 2008 Final Report Laboratory 4 Program Header file stats.h: #include <cstdlib> #include <iostream> #include <cmath> using namespace std; const int OK = 0; const double HALF = 0.5; const int NOTOK = 1; const double MAX_DIFF = 0.0; const double MIN_DIFF = 0.0; Main Program: // *********************************************************************** // File: stats.cpp // // Stats of a list of data - User enters in a series of data, and the program // outputs the average, variance, standard deviation, theoretical average, // theoretical variance, theoretical deviation, minimum value, maximum value, // and their respective differences. // // // // Author: Benjamin Jones // Created: 31 January 2008 // Updated: Original // // Assignment: Lab 4 // Compiler: MinGW32 G++ 3.4.2 (GNU) // // Inputs: User inputs a series of floating numbers, until the user inputs a // a negative value. // // Contraints: The user must a enter a non-negative floating point number or // integer. // // Outputs: The program will display in tabular format the following: // Computed Theoretical Difference // -------- ----------- ---------- // Average <average> <theo. avg.> <avg. diff.> // Variance <variance> <theo. var.> <var. diff.> // Std Dev <std. dev.> <theo. dev.> <dev. diff.> // Minimum <minimum> <minimum> // Maximum <maximum> <maximum> // // ********************************************************************* // // Modules: // // I. Get input from user // // II. Calculate statistics // // III. Calculate theoretical statistics // // IV. Find differences // // V. Output Results // // *********************************************************************** // // Design: // // I.a Begin loop while current input number (floating point) is non-negative // I.a.1 Add current number to the total sum of numbers (for average) // I.a.2 Add the square of the current number to the total sum of numbers^2 // (for variance) // I.a.3 If the maximum of minimum variables don't have value // I.a.3.A Then set current value to be both max and min // I.a.4 If the current number is greater than the max // I.a.4.A Then set current value to be the max // I.a.5 If the current number is less than the min // I.a.5.A Then set the current value to be the min // I.a.6 Increment a counter to indicate the number of loops (for N, where NI....
View Full Document

Page1 / 10

finalreport4 - Benjamin Jones 31 January 2008 Final Report...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online