Exsel Sort

I have no idea what I'm doing. I do know that it compiles without error and does not sort. I really don't understand the concept well enough to know where the problem might be (except that it is probably within the swap function, on the bottom.)

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155`` ``````#include #include #include //file input output stream using namespace std; //function prototypes int readalldata(long int[], int[], float[], const int); void findovertimehours(int[], int[], int); void findovertimepay(int[], float[], float[], int); void findregularhours(int[], int[], int); void findregularpay(int[], float[], float[], int); void findgrosspay(float[], float[], float[], int); void findtaxrate(float[], float[], int); void findtaxamount(float[], float[], float[], int); void findnetpay(float[], float[], float[], int); void printdata(float[], int); int swap (int[],int,int); //function definitions int readalldata(long int id[], int hoursworked[], float hourlyrate[], int n){ ifstream fin("payroll.in"); n=0; while(fin>>id[n]>>hoursworked[n]>>hourlyrate[n]) n++; fin.close(); return n; }//READALLDATA void findovertimehours(int hoursworked[], int overtimehours[], int n){ for(int i=0; i40) overtimehours[i]=hoursworked[i]-40; else overtimehours[i]=0; }//FOR }//FINDOVERTIMEHOURS void findovertimepay(int overtimehours[], float hourlyrate[], float overtimepay[], int n){ for(int i=0; i40) regularhours[i]=40; else regularhours[i]=hoursworked[i]; }//FOR }//FINDREGULARHOURS void findregularpay(int regularhours[], float regularpay[], float hourlyrate[], int n){ for(int i=0; i4000.00) taxrate[i]=0.40; else if(grosspay[i]>3000.00) taxrate[i]=0.30; else if(grosspay[i]>1000.00) taxrate[i]=0.20; else taxrate[i]=0.10; }//FOR }//FINDTAXRATE void findtaxamount(float grosspay[], float taxamount[], float taxrate[], int n){ for(int i=0; islot[scan+1]){ swap(slot,scan,scan+1); sortflag=1; if(slot[scan]