Homework 8 Due November 5, 2002 Solutions 6a) int alpha[15]; 6b) cout << alpha[9]; 6c) alpha[4] = 35; 6d) alpha[8] = alpha[5] + alpha[12]; 6e) alpha[3] = 3 * alpha[7] - 57; 6f) for(int i = 0; i < 15; i++) { cout << alpha[i] << " "; if((i+1) % 5 == 0) cout << endl; } 7a) funcOne(list, 50); 7b) cout << funcSum(50, list[3]); 7c) cout << funcSum(list[29], list[9]); 7d) funcTwo(list, Alist); 11) 11 16 21 26 30 A) void swap(float& x, float& y) { float temp; temp = x; // store one of the values x = y; // move y in to x y = temp; // move original x value and store in y } B) //prototype: void Max_Min_array(float a[], int, float&, float&) // implementation of function: find the max value and min value of // elements in array with length elements. void Max_Min_Array(float a[], int length, float& max, float& min) { int i; max = a[0]; // start off with max as the value of the first element min = a[0]; // start off with min as the value of the first element // examine each element of the array for(i = 1; i < length; i++) { if(a[i] < min) min = a[i]; // we found a value smaller than all so far! store it. if(a[i] > max) max = a[i]; // we found a value larger than all so far! store it. } }