Alright, so I'm using C++ Bloodshed to do a program for my college assignment, and there are a ton of errors that I keep getting, such as 'syntax error before ')' token', 'syntax error before 'else', and 'syntax error at end of input'. Here is the code, if you can help me out I would really appreciate it.
#include<cstdlib>
#include<iostream>
#include<string>
using namespace std;
int points=0; //this is a global variable. it's made of variables and planets.
string studentID;
string units[10]; //global array of ten game matches in total.
char grades[10]; //these are the global medals that are awarded.
void intro();
void load_units(); //this, the above and the below are all prototypes; defines what the function is.
void award_grades();
void award_points();
void set_units();
int main(int argc, char* argv[])
{
intro();
load_units();
award_grades();
award_points();
cout<<"You have achieved..."<<points<<endl;
set_units();
system("PAUSED!!!!");
return EXIT_SUCCESS;
}
void intro()
{
cout<<"Welcome to the Grading System for BTEC!"<<endl;
cout<<"This app will determine your grades, with either Pass, Merit, or Distinction." <<endl;
cout<<"Please enter your name to continue."<<endl;
cin>>studentID;
}
void load_points()
{
units[0]="NOCN";
units[1]="Animation";
units[2]="Game Designing";
units[3]="OSS";
units[4]="HCI";
units[5]="Digital Art";
units[6]="SAD";
units[7]="Project Planning";
units[8]="Procedural Programming";
units[9]="Database Design";
}
void award_grades()
{
int index; //This is a local variable. It more or less allows for a global variable's value to be retained.
for (index=0; index<10; index=index+1)
{
{
cout<<"What grade did you get for the"<<units[index]<<"unit?"<<endl;
cin>>grades[index];
}
void award_points();
for (index=0, index<10, index=index+1)
switch (grades[index]);
{
case'distinction':
points=points +3; //Code for the event points. The following are also event codes...
break;
case'merit':
points=points +2;
break;
case'pass':
points=points +1;
break;
case'd':
points=points +3;
break;
case'm':
points=points +2;
break;
case'p':
points=points +1;
break;
}
}
}
void set_units()
{
if(points>13)
{// if the points are more than 13 then...
cout<<studentID + "Well done! You have a distinction!"<<endl;
}
{
else if(points<8);//otherwise, if points are more than 8 but below more than 13, then...
cout<<studentID+"Congratulations, you have a merit!"<<endl;
}
{
else if(points<3); //If the points are more than 3 but not more than 8 then...
cout<<studentID+"You have a pass! Try to keep it up and get a higher grade."<<endl;
}
{
else; //if none of these conditions are met, then...
{
cout<<studentID + "Your studentID is not enlisted. Either enrol, or re-enter your name correctly. Remember, it's case-sensitive."<<endl;
}