From f2566da91396bc07356601794fd5db858a78f1f3 Mon Sep 17 00:00:00 2001 From: Michael Abed Date: Sat, 3 Mar 2012 23:32:27 -0500 Subject: make basically everything work --- Q2.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'Q2.cpp') diff --git a/Q2.cpp b/Q2.cpp index e69de29..30fd0a9 100644 --- a/Q2.cpp +++ b/Q2.cpp @@ -0,0 +1,32 @@ + +#include + +#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; +} -- cgit v1.2.3