With the following code I have seven (7) errors:
Can someone please help...
1>test.cpp
1>c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(83) : error C2601: 'displaygrader' : local function definitions are illegal
1> c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(71): this line contains a '{' which has not yet been matched
1>c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(170) : error C2062: type 'void' unexpected
1>c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(171) : error C2143: syntax error : missing ';' before '{'
1>c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(85) : error C2065: 'Class' : undeclared identifier
1>c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(86) : error C2065: 'name' : undeclared identifier
1>c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(87) : error C2065: 'Section' : undeclared identifier
1>c:\documents and settings\asiandoll\my documents\visual studio 2005\projects\test\test\test.h(94) : error C2065: 'n' : undeclared identifier
1>Generating Code...
1>Build log was saved at "file://c:\Documents and Settings\Asiandoll\My Documents\Visual Studio 2005\Projects\test\test\Debug\BuildLog.htm"
1>test - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
CODE
#include<iostream>
#include<iomanip>
using std::cout;
using std::cin;
using std::endl;
using std::setprecision;
using std::ios;
using std::setiosflags;
void displaygrader();
void displaycalculator();
int main()
{
int choice;
int left, right;
int Enter1;
int Enter2;
char oper;
int result;
char name[50];
char Class[100];
char Section[100];
int average,
a,
b,
c,
d,
f,
n,
sum,
gpa,
grade,
gradeCounter,
total;
//initialization phase
n=1;
grade=0;
gradeCounter=n;
total=0;
a=4;
b=3;
c=2;
d=1;
f=0; //prepare to loop
//display output in fixed-point notation
//with two decimal places
cout <<setiosflags (ios::fixed) <<setprecision(2);
// processing phase
cout<<"Welcome to my program"<<endl;
cout<<endl;
cout<<endl;
cout<<"What is your name? I would prefer it, if you entered only your first name"<<endl;
cin>>name;
cout<<"So tell me "<<name<< "Which program would like to use the Grader or the Calculator"<<endl;
cout<<endl;
do
{
cout<<"1 Display grader"<<endl;
cout<<"2 Display calculator"<< endl;
cout<<"3 End program" <<endl;
cout<<"Enter your choice: ";
cin>> choice;
if (choice == 1)
displaygrader();
else if(choice == 2)
displaycalculator();
void displaygrader()
{
cout<<"What class are you in"<<endl;
cin>>Class;
cout<<"What section are you in then "<<name<<endl;
cin>>Section;
cout<<endl;
cout<<endl;
cout<<"Okay enough of information. It's time to calculate your grades"<<endl;
cout<<endl;
cout<<endl;
cout<<"Please enter the number of grades to be calculated: "<<endl;
cin>>n;
}
//loop statment
while (gradeCounter <= n); {
cout<<"Please enter grade: ";
cin>>grade;
total=total + grade;
gradeCounter= gradeCounter + 1;
}//end while
//Calculation of the problem
average=total/n;
sum=total+grade;
cout<<"Your average is "<<average<<"%"<<endl;
cout<<"The sum of your scores is "<<sum<<endl;
cout<<endl;
cout<<endl;
if (average>=84) {
cout<<"You received an A in the course! good job!"<<endl;
cout<<endl;
cout<<"Keep up the good work!"<<endl;
}
else if(average>=66) {
cout<<"You receieved a B in the course! keep up the good work!"<<endl;
cout<<endl;
cout<<endl;
}
else if (average>=50) {
cout<<"You received a C in the course. You need improvement!"<<endl;
cout<<endl;
cout<<"You can do better!"<<endl;
}
else if (average>=45) {
cout<<"You received a D! that is terrible!"<<endl;
cout<<endl;
&