### Need help finding the average of grades.

I have 3 students in a row and 5 grades for every student in a column.I needed the class average which i already found but i still need to find the average for individual student. I don't know how to begin and need help with that.

Following is my code so far

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136`` ``````#include #include using namespace std; const int R=3; //number of rows const int C=5; //number of coloumn const int N=15; void showNamesAndScores(int scores[][C], char names[][N], int); double calcAvg(int X[][C], int); char classAvg(int X[][C], int); double calcAvg(int X[][C], int s) { double a; double sum = 0; for(int i=0; i>names[i]; cout<>scores[i][j]; } cout<
You ging in the right direction...
But i would make a single function to use for both averages:

 ``12345678910111213141516171819`` ``````double calcAvg( int * arr , int size ) { long sum =0; for(int i =0;i

It is not tested...so if in doesn't work i am glad to help....
Last edited on
Its not really working..
what does not work? I do not have a pc nearby.. I am using a tablet..
Last edited on
Topic archived. No new replies allowed.