hey guys can u help me to solve this program

have to do 4 function , call the following functions by passing the array:
(i) A function to input all information.
(ii) A function to calculate the average score for each student and the average score for the class. Find the student with highest and lowest average score.
(iii) A function to find students who score lower than 50 marks.
(iv) A function to display all the information. The information should be displayed in a proper format.

#include <iostream>
using namespace std;

const int NUM_NAMES =5;          //how many occurances
const int NAMESIZE = 11;          //how long names can be, 10 letters
const int NUM_TESTS = 3;        //how many tests
char name[NUM_NAMES][NAMESIZE];   //two-dimensional name array
char grade[5];            //grade letter for each student array
double testscore[NUM_NAMES][NUM_TESTS];          //test score for each student
double average[5];        //average for each student array

//function prototype
void calcdata(int, double[][NUM_TESTS]);

//start of main
int main()

cout <<  "Enter the student's name. \n";
for (int count = 0; count < NUM_NAMES; count++)
    cout << "Student  " << (count +1) <<": ";
    cin >> name[count];
    for (int student = 0; student < NUM_NAMES; student++)
        for (int testnum = 0; testnum < NUM_TESTS; testnum++)
            cout << "what is the test score for " << name[student];
            cout << " for test:" << testnum+1<< endl;
            cin >> testscore[student][testnum];

            while (testscore[student][testnum] < 0 || testscore[student][testnum] > 100)
                cout << "Please enter a number between 0 and 100" << endl;
                cin >> testscore[student][testnum];
                    cout << endl;


//call to function calcdata
    calcdata(NUM_NAMES, testscore);


return 0;
} //end of main

void calcdata(int NUM_NAMES, double testscore[][NUM_TESTS])
    double total;
//get each students average score
for (int row = 0; row < NUM_NAMES; row++)
    //set the accumulator.
    total = 0;

    //sum a row
    for (int col = 0; col < NUM_TESTS; col++)

        total += testscore[row][col];

        //get the average
        average[row] = total / NUM_TESTS;

        //get the grade
        if (average[row] < 60)
            grade[row] = 'F';
        else if (average[row] < 70)
            grade[row] = 'D';
        else if (average[row] < 80)
            grade[row] = 'C';
        else if (average[row] < 90)
            grade[row] = 'B';
        else if (average[row] < 100)
            grade[row] = 'A';


for (int i = 0; i < 5; i++)
cout << "Student: " << name[i]
      <<" average: " << average[i]
       <<" grade: " << grade[i]
       << endl;


For future reference please enclose any code posted to this forum in code tags. The directions on how to do so are posted several places throught the board.

Second, please ask a specific question. It's unlikely that anyone with run your code to get their own error messages and try to tell you how to fix them. It's unlikely that anyone with complete the project for you. It's up to you to be specific in your request for explanation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.