Question: Make a program using c++ that will search through scores of an array and display the scores in descending order to simulate a high score
Make a program using c++ that will search through scores of an array and display the scores in descending order to simulate a high score leaderboard. The program should contain the following:
main() - In main, declare an array called scores[]. Ask the user for 5 scores. Store the 5 scores in scores[]. Call a function called sortScores() and pass the array by reference. Call a function called displayScores(). Pass the array by value into that function.
sortScores() - This function will accept an array passed by reference and the size of the array. The function will use the selection sort algorithm to sort through array. You will need to modify the algorithm to sort the scores from greatest to least. This function returns no data.
displayScores() - This function accepts an array passed and will cout the contents of the array. Hint: You can use this function during development to see the array unsorted and sorted.
The program should look like the following:

CAWINDOWSlsystem32 cmd.exe Enter 5 scores: 2345 5123 3234 1673 4235 THE TOP SCORES 5123 2: 4235 3 3234 4: 2345 5: 1673 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
