Write a program that dynamically allocates an array large


Assignment

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 by the user, the array must be passed to a function that sorts them in ascending order. It must use another function that calculates the average score. The program should display the sorted list of scores and average with appropriate headings. The program must use pointer notation instead of array notation. Validation: Do not accept negative numbers for test scores; keep prompting the user for a new grade. Do not accept negative numbers for the number of scores the user wants to enter. The output should look like this:

Score
67.40
67.80
77.60
99.60
Average Score: 78.10

Program must have the following functions

• void getGrades(double* score, int size)
• void displayGrades(double* score, int size, double avg)
• void sort(double* score, int size)
• double average(double* score, int numScores)

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Write a program that dynamically allocates an array large
Reference No:- TGS02446396

Now Priced at $30 (50% Discount)

Recommended (94%)

Rated (4.6/5)