#include "stdstuff.h" // here's a little program with all the ECOR 1606 final lab test type // statistics. int main() { int count = 0, sum = 0; int value, max, min; // loop until the user enters -1 for(;;) { // get the next input value cout << "Enter an integer (-1 to exit): "; cin >> value; if(value==-1) break; // exit when user enters -1 // if it's the first time or this value is less than the // current minimum, change the current minimum if (count==0||valuemax) max=value; // increment count and add value to sum count++; sum+=value; } // now do the statistics if (count==0) cout << "No values entered.\n"; else cout << count << " values were entered.\n" << "The sum of the values is: " << sum << endl << "The average of the values is: " << (double)sum/count << endl << "The smallest value is: " << min << endl << "The largest value is: " << max << endl; pause(); return 0; }