Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to use the user Inuput in my code for the loop instead of \"3\". I tried

ID: 3657628 • Letter: I

Question

I need to use the user Inuput in my code for the loop instead of "3". I tried using userNum or getNum but both give me an error. What should I use for this? //The program to determine letter grades #include #include #include #include using namespace std; //Function prototupe.Both functions use reference variables as parameters void getNum(int &); void calculateaverage(double &); char calculategrade(double); int main() { int value; double avg=0; //Get number and store it in value getNum(value); //Calculate average and store into it calculateaverage(avg); //calculate grade calculategrade(avg); cout<<"The grade is "<<calculategrade(avg)<<endl; system("pause"); } void getNum(int &userNum) { cout<<"Enter number of grades: "; cin>>userNum; cout<<endl; } void calculateaverage(double &avg) { int score; for(int i=0; i<3; i++) { cout<<"Enter numeric grade between 0-100: "; cin>>score; cout<<endl; //cout<<score; avg+=score; //compute the average of the student } avg/=3.0; //cout<<avg<<endl; }//end function //return the grade of the student char calculategrade(double myAvg) { //compute the grade and return if(myAvg<60) return 'F'; else if(myAvg >60 && myAvg<70) return 'D'; else if (myAvg>70 && myAvg<80) return 'C'; else if(myAvg>80 &&myAvg<90) return 'B'; else return 'A'; }//end function calculate grade

Explanation / Answer

use for loop for(i=1;i