Syntax errors will be the death of me!

  • From: Jes <theeternalkid@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Sat, 10 Jul 2010 22:20:33 -0400

Hey guys,
Here's a code for an assignment which has to be turned in tomorrow. Every time 
I try to compile it, Visual Studio keeps telling me I'm missing a ; before <<
What's wrong?
Code follows:
//Ch6ConE06.cpp
//Displays a class rank based on a code 
//entered by the user
//Created/revised by <your name> on <current date>

#include <iostream>

using std::cout;
using std::cin;
using std::endl;

int main()
{       
        //declare variable
        int code = 0;

        //enter input
        cout << "Enter the code: ";
        cin >> code;
//enter switch statements
switch(code)
{
case 1:;
cout << "Freshman. " ; << endl;
break;
case 2:
        cout <<"Sophomore"; << endl;
break;
case 3:
cout << "Junior "; << endl;
break;
case 4:
cout << "Senior" ; << endl;
break;
case 5:
cout << "Error! "; << endl;
}
//endswitch
//display output

    return 0;
}   //end of main function

Jes

Other related posts: