I am supposed to write a program that dynamically allocates an array large enough to hols a user-defined number of test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascendin 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).
Input Validation: do not accept negative numbers for test scores.
My problem is basically with passing the array to a function and sorting it. I have written the first part of the program i.e dynamially allocating the array. I think i can also write the other part of the program.
Take a look at this. A pointer to the first array element and one past the last array element can be passed to a sort algorithm. So even if you just use a dynamic c-array you can still use std::sort and it will sort ascending by default. http://cplusplus.com/reference/algorithm/sort/
This website has array tutorials as well as many articles on the subject. I suggest that you start reading and then post your code if you need help with anything specific. Also please attempt to debug the program yourself. Don't just post something that doesn't even compile and ask someone to tell you why it doesn't work.