/* Matt Lopes 100324673 Quiz7 Chapter 8 this took me so long to do and i dont know why i hate function templates please dont put them on the exam <3 */ #include using namespace std; template void bubbleSort(T array[], S NUMEL) { int i, j; double temp; for ( i = 0; i < (NUMEL - 1); i++) { for(j = 1; j < NUMEL; j++) { if (array[j] < array[j-1]) { temp = array[j]; array[j] = array[j-1]; array[j-1] = temp; } } } } int main() { const int NUMEL = 10; double array[NUMEL]; int i; cout << "Enter 10 numbers\n"; for (i = 0; i < 10 ; i++ ) { cin>>array [i]; } bubbleSort(array, NUMEL); cout << "The sorted list, in ascending order, is:\n"; for (i = 0; i < NUMEL; i++) { cout << " " << array[i] << endl; } system("pause"); return 0; }