diff options
author | Michael Abed <michaelabed@gmail.com> | 2012-03-03 23:32:27 -0500 |
---|---|---|
committer | Michael Abed <michaelabed@gmail.com> | 2012-03-03 23:32:27 -0500 |
commit | f2566da91396bc07356601794fd5db858a78f1f3 (patch) | |
tree | 6d18e7e9a517163dee5929eef6617cce12cfb415 /Q2.cpp | |
parent | 12993b517ff2f8ec6608c2deaf3e988c64f7f164 (diff) | |
download | ec327-lab2-f2566da91396bc07356601794fd5db858a78f1f3.tar.gz ec327-lab2-f2566da91396bc07356601794fd5db858a78f1f3.tar.bz2 ec327-lab2-f2566da91396bc07356601794fd5db858a78f1f3.zip |
make basically everything work
Diffstat (limited to 'Q2.cpp')
-rw-r--r-- | Q2.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -0,0 +1,32 @@ + +#include <iostream> + +#include "statistics.h" + +using namespace std; + +int main(int argc, const char *argv[]) +{ + char input[256]; // max filename length for most systems + + float mean, min, max, mode; + + cout << "Please input a filename to use for data" << endl; + cout << ">> "; + cin >> input; + + if (argc > 1) + write_data(input, 1000, 500); + + mean = get_mean(input); + min = get_minimum(input); + max = get_maximum(input); + mode = get_mode(input); + + cout << "Mean: " << mean << endl; + cout << "Min: " << min << endl; + cout << "Max: " << max << endl; + cout << "Mode: " << mode << endl; + + return 0; +} |