Last active
          December 7, 2015 06:02 
        
      - 
      
 - 
        
Save hr1383/182c78fe963605778b19 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
hr1383 revised this gist
Dec 7, 2015 . 1 changed file with 19 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,21 @@ change this for (count; count < arraySize-1; count++) { for (secondCounter = count + 1; secondCounter < arraySize; secondCounter++) { if (rec[count].salary > rec[secondCounter].salary) { temp = rec[count].salary; rec[count].salary = rec[secondCounter].salary; rec[secondCounter].salary = temp; } } } to // you need to swap the entire record for (count; count < arraySize-1; count++) { for (secondCounter = count + 1; secondCounter < arraySize; secondCounter++) { if (rec[count].salary > rec[secondCounter].salary) { temp = rec[count]; rec[count] = rec[secondCounter]; rec[secondCounter] = temp; } } }  - 
        
hr1383 created this gist
Dec 6, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ void greaterThanYerAvg(int array[], int arraySize, double average, ofstream & newFile) { int num; int avgCount for (int count = 0; count < arraySize; count++) { if (array[count] > average) { num = array[count]; newFile << num << "\t"; avgCount++ if ((avgCount + 1) % 5 == 0) { newFile << endl << endl; } } //newFile << endl << endl; } }