I cant figure out this problem i think i have everything right but i cant get it to compile, no idea where i messed up, please help if you can.
Create a class Student. The class has member data: name and tests (array of 3 test scores). It has several functions: setName, getName, setTests, and displayResult. The function setTests will copy the test scores from the integer array argument into the class data tests. The function displayResult will first calculate the average score from the 3 test scores. It then displays studentís name, 3 test scores and the average score on the same line. You must create Student.h file to store class definition; Student.cpp file to store the class implementation code; and mid2.cpp to store the main function of the program.
using namespace std;
void Student::setName(string name)
n = name;
void Student::setTests(int tests)
for (int i=0;i<3;i++)
t[i] = tests[i];
a = (t+t+t)/3;
cout << "Name" << "Tests" << "Average" << endl;
cout << getName << t << " " << t << " " << t << a << endl;
cout << "Enter student name: ";
cout << "Enter student test scores: ";
cin >> t >> t >> t;