TEST SCORES

Hi please i need help with this question.

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.

Thanks
So, what do you need help with?
I need help with the whole question
That's not very useful. What, am I supposed to write it for you? What, specifically, are you having trouble with? What have you tried so far?
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.
I'm still not following you. You have issues with "passing an array to a function and sorting it" -- what issues?

If you don't tell me what you're having trouble with, I can't help you :S
Take a look at this for your stream validation.
http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.3

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/

For C++ dynamic array
http://cplusplus.com/reference/stl/vector/

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.
Seen. will get back ..
tnx
well i wrote it myself.. was quite easy though;

but tnx 4 tryin to help
Topic archived. No new replies allowed.