I am trying to write a function that will compute GPA.
#include "Student.h"
#include "ClassInformation.h"
Student* setupStudent(){
string f,l,idNo;
double gPoint=0;
Student *studPtr1;
studPtr1 = new Student ();
cout<<"Enter first name ";
cin>>f;
studPtr1->setfirstName(f);
cout<<"Enter last name ";
cin>>l;
studPtr1->setlastName(l);
cout<<"Enter A number";
cin>>idNo;
studPtr1->setaNumber(idNo);
cout<<endl;
studPtr1->setGPA(gPoint);
return studPtr1;
}
ClassInformation* setupClassInformationArrary(int *length){
int *maxClasses;
ClassInformation *classInfo;
classInfo = new ClassInformation[*maxClasses];
return classInfo;
};
void readClassInformation(ClassInformation*singleGlass){
string cName;
int cNumber,h;
char g;
cout<<"Enter class name ";
cin>>cName;
singleGlass->setclassName(cName);//change these lines
cout<<"Enter class number";
cin>>cNumber;
singleGlass->setclassNumber(cNumber);
cout<<" Enter credit hours ";
cin>>h;
singleGlass->setcreditHrs(h);
cout<<"Enter student's letter grade";
cin>>g;
singleGlass->setletterGrade(g);
};
void computeGPA (Student *studPtr1,ClassInformation *singleGlass[],int numClasses){
int gpa=0;
for (int i=1;i<numClasses;i++){
"studPtr1.singleGlass[i].getletterGrade()"; *
"singleGlass[i].getcreditHrs()"/
gpa= gpa+ "singleGlass[i].getcreditHrs()";
}
// (grade * credithour) + (grade * credithour) / credithour+credithour = gpa
};
When I debug I have a warning of "+" operator has no effect, expected operator with side-effect.
Any help would be greatly appreciated. Thank you in advance.