Help with functions

Hi, I am new in C++ programming. Just got to know about this site. I really need help with an assignment here on "functions". I'm having a hard time understanding it. Getting this will help me with others. Question is;

Write a program that asks the user for the number of students in the class. The program then asks the user for the grade of each student and computes/displays the average grade in the class. The number of students should be used as a parameter to the function that will calculate the average of the class. Your function cannot be void, in other words this function will return the avg calculated to the main program.

I'll appreciate any helps here.
Thanks in advance

1
2
3
4
5
double classAverage(int numberOfStudents){

// Do your calculation here

}
Show us what you've done so far and we'll put you in the right direction. Copy-pasting a homework problem and expecting someone to spoonfeed you the code will not make you a good programmer. Practice makes perfect.
Last edited on
Topic archived. No new replies allowed.