What is wrong with this code?

gradebook.h:
#include <string> // class GradeBook uses C++ standard string class
#include <iostream>
#include <iomanip>
using namespace std;
// GradeBook class definition
class GradeBook
{
public:
void determineclassaverage();


// course name for this GradeBook
};// end class GradeBook
cpp:
#include "GradeBook.h"
using namespace std;

void determineclassaverage()
{
int total=0;
int average=0;
int counter=0;
int grade=0;
while(grade!=1){
cout<<"Enter grade,-1 to stop/n";
cin>>grade;
total=total+grade;
counter=counter+1;}
average=total/counter;
cout<<"Average is"<<average;
// call set function to initialize courseName
} // end GradeBook constructor


int main()
{
GradeBook mygradebook1;
cout<<"Welcome to the grade average calculator./n";
mygradebook1.determineclassaverage();
system("pause");
}


what is wrong? thx
What makes you think something is wrong? Does your computer electrocute you when you run it? Does it cause a fuse to blow? Does it download and install a virus? You need to be specific.
Cannot compile?
Copy and paste the exact error you get.
these should not be in your header
1
2
3
4
#include <string> // class GradeBook uses C++ standard string class
#include <iostream>
#include <iomanip>
using namespace std;


Also I don't see you using anything from the string library or manip

Then in your main .cpp you are forgetting to include iostream.
Topic archived. No new replies allowed.