average::average()
{
name = "student";
grade = "F";
}
string average :: get_name()
{
return name;
}
string average :: get_name2()
{
return name2;
}
string average :: get_grade()
{
return grade;
}
void average :: set_grade(int count, float temp2[])
{
for (int j=0; j<count; j++){
sum+=temp2[j];}
avg=sum/count;
if (avg>=93){grade="A";}
else if (avg>=87){grade="A-";}
else if (avg>=83){grade="B+";}
else if (avg>=80){grade="B";}
else if (avg>=77){grade="B-";}
else if (avg>=73){grade="C+";}
else if (avg>=70){grade="C";}
else if (avg>=67){grade="C-";}
else if (avg>=63){grade="D+";}
else if (avg>=60){grade="D";}
else if (avg>=57){grade="D-";}
else {grade="F";}
}
void average :: set_name(string temp1)
{
name=temp1;
}
void average :: set_name2(string temp3)
{
name2=temp3;
}
int main()
{
int choice;
ifstream file;
char fname[40];
char outname[40];
bool option1=false;
average *student;
int num;
int j=0;
bool end=false;
bool done=false;
int k=0;
But just looking at your code I found a few beginner mistakes. First of all, you should never-ever use a go-to statement. It's been deprecated in C++, and it leads to bad programming habits. And You might want to take out system("PAUSE"), I hear it causes issues with programs.... you should use something like cin.ignore() instead if your looking to hold the console window open.
System("pause") is inefficient, and is a big security risk. There's some good articles out there on why. Why people still teach it, no one will ever know.