If you could put some comments into the code so I could learn as I go that
Question:
If you could put some comments into the code so I could learn as I go that would be amazing thanks.
COP 3223- HW on one dimensional arrays
The goal is to write a C program that runs as shown in following sample run:
Sample Run:
Enter how many students do you have ( but up to 50): 6
Enter the 6 scores: 100 85 78 90 40 65
Here are the scores with their corresponding grades:
100 A
85 B
78 C
90 A
40 F
65 D
The average score is: 76.33
There are 4 out 6 who scored above the average. Goodbye!
For this, use the following functions:
void loadScores ( int S[] , int * n) This function asks the user to enter how many scores (into the pointee of n) and loads *n scores into array S
void printGrades ( int S[] , int n ); This function prints each score and its letter grade, using the standard grade assignment ( A if score is between 90 and 100. B if score is between 80 and 89, … etc)
double average ( int S[] , int n ); This function returns the average of the n scores stored in array S
int countAboveAvg ( int S[] , double avg, int n); This function counts and returns how many students scored above or equal to the average score (avg). S is the array, avg is the average score and n is how many scores to consider in S.