hey everyone. i'm confused on how to create an array of numbers into a program and have that program ask for each input. here is what i have to do:


Write a program that reads 20 student homework scores. These score numbers can only be between 0 and 10. Use an array of integer type to store the scores. The program uses the scores to calculate the average score, the smallest score, and the highest score. The
average score should have a decimal fraction. Then create three user-defined functions:
- double average(int ar[])
to calculate the average of the scores,
- int smallest(int ar[])
to find the smallest score and,
- int largest(int ar[])
to find the largest score.



Function main

Define an array of 20 integers
Define an integer arrIndex and set to 0

Use a loop to read 20 scores
- each score is stored in an array element using arrIndex as the index.
- increment the arrIndex

Call the function average(), passing the array data, to get average of the numbers.
Display the mean

Call the function smallest(), passing the array data, to get smallest of the numbers.
Display the smallest

Call the function largest(), passing the array data, to get largest of the numbers.
Display the largest number

HINTS

- Use #defined to define these constants for program
#define ARRAY_SIZE 20
#define HIGHEST_SCORE 10
#define LOWEST_SCORE 0

Then use ARRAY_SIZE in all the places that refer to the array size. Don’t hard-code the 20 inside your code!

Use the ‘if’ statement to make sure that each entered score is between 0 and 10 inclusively.

here is an example of an output:

Enter the score 1: 10
Enter the score 2: 9
Enter the score 3: 11
Invalid score! A score has to be from 1 up to 10.
Enter the score 3: 9
Enter the score 4: 8
Enter the score 5: 1
Enter the score 6: 3
Enter the score 7: 7
Enter the score 8: 6
Enter the score 9: 6
Enter the score 10: 8
Enter the score 11: 5
Enter the score 12: 4
Enter the score 13: 6
Enter the score 14: 7
Enter the score 15: 8
Enter the score 16: 9
Enter the score 17: 4
Enter the score 18: 4
Enter the score 19: 7
Enter the score 20: 7



The average score is 6.40








if someone could help i'd appreciate it very much. thank you!!