Write a program that will input letters grade(A,B,C,D,F), the number of which is input by the user (a maximum of 50 grades). The grades will be read into array. A function will be called five times(once for each letter grade) and will return the total number of grades in that category. The function must be passed 3 parameters: the array, the number of elements in the array, and the letter to be searched for and counted (A, B, C, D or F). The program will print the number of each grade.
Additional Information:
Store all the input grades one by one in an array;
The function prototype looks like the following:
int countChar(char[], int, char);
The function will go through the array and count how many occurrences for the designated letter grade.
Sample Run:
Please input the number of grades to be read in.(1-50): 6
all grades must be upper case A B C D or F
?Input a grade: A
Input a grade: C
Input a grade: A
Input a grade: B
Input a grade: B
Input a grade: D
Number of As = 2
Number of Bs =2
Number of Cs = 1
Number of Ds = 1
Number of Fs = 0
???
??