Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that dynamically allocates an array large enough to hold a user-

ID: 3639503 • Letter: W

Question

Write a program that dynamically allocates an array large enough to hold a user- defined number of test scores. Once all the scores are entered, the array should be passed to a func-tion that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the sorted list of scores and averages with appropriate headings. Use pointer notation rather than array notation whenever possible and make sure you delete the array after displaying the scores.
Input Validation: Do not accept negative numbers for test scores.

Explanation / Answer

#include #include #include #include using namespace std; int getInt(const string&); void sortIntArray(int *, int); float computeAvg(const int * const, int); int main(int argc, char *argv[]) { int N, *scores; while ((N = getInt("Enter number of scores: "))
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote