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

how do you call member functions? what am i doing wrong here i keep getting this

ID: 3642143 • Letter: H

Question

how do you call member functions? what am i doing wrong here i keep getting this error message 1>somethinggood.cpp(79): error C2039: 'getData' : is not a member of 'System::Int32'

this is my code:

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>

using namespace std;


void MainMenu ()
{
cout <<""<< endl;
cout <<" =================================================================="<< endl;
cout <<" Computation of Final Grades of Students initiated "<< endl;
cout <<" =================================================================="<< endl;
}

class myStudent
{
private:
char fname[46];
int midExam[46];
int finExam[46];
double QuizAvg[46];
double finGrade[46];

public:
void getData ();
void showFinGrade ();
double calFinGrade ();
};

void myStudent::getData ()
{
ifstream Student_data;// opens students data
Student_data.open("FirstName.txt");// opens the names of the student and puts it in a 1D array.
for(int i=0; i<46; i++)
{
Student_data >> fname[i];
}
Student_data.open("QuizAvg.txt");// opens the Quiz avgs and puts them into a 1d array.
for(int j=0; j<46; j++)
{
Student_data >> midExam[j];
}
Student_data.open("MidtermExam.txt");
for(int k=0; k<46; k++)
{
Student_data >> midExam[k];
}
Student_data.open("FinalExam");
for(int f; f<46; f++)
{
Student_data >> finExam[f];
}
}

void myStudent::showFinGrade ()
{
cout <<setw(50)<<fname<<setw(50) <<finGrade <<endl;
}

double myStudent::calFinGrade()
{
for(int z=0; z<46; z++)

finGrade[z] = 0.35*midExam[z] + 0.3*QuizAvg[z] + .35*finExam[z];
return finGrade[46];
}


int main()
{
int sum=0;
MainMenu();
myStudent; int students[46];
cout<<setw(50) <<" Last Name"<< setw(50) <<" Final Grade " << endl;
for (int i= 0; i<46; i++)
{
students[i].getData();
students[i].calFinGrade();
students[i].showFinGrade();
}
}


Explanation / Answer

Try this. You have to dereference a char[] in order to get the contents inside, you cant just say "cout