#include #include using namespace std; //Deborah Whitfield /*If you didn't see these in 146, these are function prototypes. By using prototypes, the functions can appear after main. Prototypes can be identical to a function header followed by a semicolon. Prototypes do not require parameter names. */ const int MAX = 20; int Sum (const int []); double Sum (const double []); void Compare (const int [], int&, int&); //The purpose of this lab is to int main(int argc, char *argv[]) { int numbers[MAX]; int sum=0, //the sum of the array LrgNum=0, //the largest number in the array SmlNum=0; //the smallest number in the array double costs[MAX], total; // LoadArrays sum = Sum (numbers); total = Sum (costs); Compare (numbers, SmlNum, LrgNum); cout << "The sum of the numbers is: " << sum << endl; cout << "The total of the costs is: " << total << endl; cout << "The smallest number is: " << SmlNum << endl; cout << "The largest number is: " << LrgNum << endl; } //Compute the sum of the array int Sum (const int numbers[]) { int sumNum=0; return sumNum; } //Compute the sum of the array double Sum (const double numbers[]) { double sumNum=0.0; return sumNum; } //Determine largest and smallest number //Return BOTH numbers by using pass-by-reference void Compare (const int numbers[], int& Sml, int& Lrg) { //Setting the smallest and largest found to a "out of range" value // What is better than this? Sml=9999; Lrg=-1; }