I need to keep track of students last names and their GPAs. I need the user to enter 7 names and their GPA. I need to output it in columns. Also I need the average GPA and the Highest GPA. And I also need 'Last Name' earned the highest GPA.
This is what I have. PLEASE HELP
int main()
{
int nameArray[7], gPAArray[7];
double averageGPA=0, highGPA=0, gpa;
ofstream out;
out.open("g:\\StudentGPAOut.txt");
cout<<"please enter your last name. ";
cin>>nameArray[7];
cout<<endl;
cout<<"please enter your GPA(0-4.0 scaled). ";
cin>>gPAArray[7];
cout<<endl;
out<<fixed<<showpoint;
out<<setprecision(2);
out<<setfill('.')<<left<<setw(18)<< "Last Name: "
<<right<< " "<< "GPA: "<<endl;
out<<setfill('.')<<left<<setw(18)<<nameArray;
out<<right<< " "<<gPAArray<<endl;
out<<"Last Name earned the highest GPA.";
out.close();
return 0;
}