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.