type 'double' unexpected

I am writing a program for a class that I am taking and when trying to define the constant 'pi' I am getting error C2062: type 'double' unexpected. Below, I have attached my code. I am completely open to suggestions as I am a beginner at this. Thank you in advance for your help!

#include <iostream>
#include <iomanip>

using namespace std;

int main ()

{
int choice,

//error C2602: type 'double' unexpected
const double pi = 3.14159 ;

float radius,length,width,base,height,circ_area,rect_area ,tri_area ;

cout << " Geometry Calculator " << endl ;

cout << " " << endl ;

//HOW DO I SET WIDTH ??
cout << setw(5) << " 1. Calculate the Area of a Circle " << endl ;

cout << setw(5) << " 2. Calcualte the Area of a Rectangle " << endl ;

cout << setw(5) << " 3. Calcualte the Area of a Triangle " << endl ;

cout << setw(5) << " 4. Quit " << endl ;

cout << " Enter your choice (1-4): " ;
cin >> choice ;

cout << setiosflags (ios::fixed|ios::showpoint) << setprecision(4) ;

switch (choice)

{ case 1 : cout << " Please enter the radius of the circle and press <ENTER> : " ;
cin >> radius ;
circ_area = pi * radius * radius ;
cout << " The area of the circle is " << circ_area << ". " << endl ;
break ;

case 2 : cout << " Please enter the length of the rectangle and press <ENTER> : " ;
cin >> length ;
cout << " Now enter the width of the rectangle and press <ENTER> : " ;
cin >> width ;
rect_area = length * width ;
cout << " The area of the rectangle is " << rect_area << ". " << endl ;
break ;

case 3 : cout << " Please enter the length of the triangle's base and press <ENTER> : " ;
cin >> base ;
cout << " Now enter the height of the triangle and press <ENTER> : " ;
cin >> height ;
tri_area = base * height / 2 ;
cout << " The area of the triangle is " << tri_area << ". " << endl ;
break ;
}

if (choice < 1 || choice > 4)
cout << " You did not enter a valid menu selection. " << endl ;

system("PAUSE") ;

return 0 ;
}
int choice, should be int choice;
WOW! I have no idea why I didn't catch that. Thank you for your help!
Topic archived. No new replies allowed.