The code below is a partial copy of ScoreAnalyzer.cpp, which…
The code below is a partial copy of ScoreAnalyzer.cpp, which was posted on December 1st, 2025. In the text box below, rewrite the main() function only. Rewrite the main() function in ScoreAnalyzer.cpp without mistakes for 10 points, or rewrite the main() function, replacing the // Variable declaration statements and // Program processing statements comments with the code you wrote in response to the list of modifications in the December 1st, 2025 announcement. #include #include using namespace std;void selectionSort(int[], int);int main(){ // Variable declaration statements cout > numScores; int *scores = new int[numScores]; // create the array // Program processing statements delete[] scores; // return the storage to the heap return 0;}void selectionSort(int num[], int numel){ int i, j, min, minidx, temp; for (i = 0; i < (numel - 1); i++) { min = num[i]; // assume minimum is the first array element minidx = i; // index of minimum element for (j = i + 1; j < numel; j++) { if (num[j] < min) // if you've located a lower value { // capture it min = num[j]; minidx = j; } } if (min < num[i]) // check whether you have a new minimum { // and if you do, swap values temp = num[i]; num[i] = min; num[minidx] = temp; } }}
Read Details