// finder.cpp - finds min and max of integer array (Nagler exercise 4.2, p. 59) // CS 60 assignment 4, part 2, Fall 2009 // YOUR NAME, DATE #include #include using namespace std; // solution to 2.a: forward declaration for find function - HERE // main is slightly expanded from Nagler, p. 59 int main() { int const array1[] = { 5, -6, 21, 15, -8 }; size_t const dimension1 = sizeof(array1) / sizeof(*array1); int min, max; find(array1, dimension1, min, max); cout << "min1 = " << min << ", max1 = " << max << '\n'; int const array2[] = { 70, -19, -12, 1, -11, 0, -22, 4, 15 }; size_t const dimension2 = sizeof(array2) / sizeof(*array2); find(array2, dimension2, min, max); cout << "min2 = " << min << ", max2 = " << max << '\n'; } // solution to 2.b: implementation of find function - BELOW