This program only compiles if the number of grades has already been predetermined, but not if the number is a value declared by the user (which varies each time the program is run).
Write a program that will read in grades, the number of which is
also input by the user. The program will find the sum of those grades and
pass it, along with the number of grades, to a function which has a “pass
by reference” parameter that will contain the numeric average of those
grades as processed by the function. The main function will then determine
the letter grade of that average based on a 10-point scale.