All pastes #980680 Raw Edit

Untitled

public cpp v1 · immutable
·published 2008-04-11 05:03 UTC
rendered paste body
/*Matt Lopes 100324673Quiz7 Chapter 8this took me so long to do and i dont know whyi hate function templatesplease dont put them on the exam <3*/#include <iostream>using namespace std;template <class T, class S>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;}