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 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.