online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <iomanip> #include <string> #include <cmath> using namespace std; int main() { //Declare and Initialize the variables. int choice; string name; int shirt; double rate; string event; //Constants for the Art Show's and Prices. const double balboaRate= 30.0, oceansideRate= 35.0, cuyamacaRate=25.0; //Constants for menu choices. const int balboaChoice= 1, oceansideChoice= 2, cuyamacaChoice= 3, quitChoice=4; //Display the Menu and choice. cout<<"\t\tArt Show Events Menu\n\n" <<"1. Balboa Park"<<endl <<"2. Oceanside Pier"<<endl <<"3. Lake Cuyamaca"<<endl <<"4. Quit Program"<<endl<<endl <<"Enter your choice"<<endl; cin>>choice; //Set the numeric output formatting. cout<<fixed<<showpoint<<setprecision(2); //Respond to user's menu selection. switch (choice) { case balboaChoice: cout<<"Welcome to the Balboa Park Art Show!"<<endl; rate=balboaRate; if(shirt=='y') { rate +=20; } else if(shirt=='n') { rate; } event="Balboa Park"; cout<<"The cost for admission is $"<<balboaRate<<endl; break; case oceansideChoice: cout<<"Welcome to the Oceanside Pier Art Show!"<<endl; rate=oceansideRate; if(shirt=='y') { rate +=20; } else if(shirt=='n') { rate; } event="Oceanside Pier"; cout<<"The cost for admission is $"<<oceansideRate<<endl; break; case cuyamacaChoice: cout<<"Welcome to the Lake Cuyamaca Art Show!"<<endl; rate=cuyamacaRate; if(shirt=='y') { rate +=20; } if(shirt=='n') { rate; } event="Lake Cuyamaca"; cout<<"The cost for admission is $"<<cuyamacaRate<<endl; break; case quitChoice: cout<<"Program Ending"<<endl; break; default: cout<<"The valid choice are 1,2,3 or 4. Run the\n" <<"Program again and select one of those.\n"; } //Ask for user's name. cout<<"Plase enter your first name: "<<endl; cin>>name; //Ask if they are willing to purchase t-shirt. cout<<"Would you like to purchase a t-shirt for only $20? (y/n)"<<endl; cin>>shirt; //Show the user there information. cout<<"Firt name: "<<name<<endl; cout<<"Event: "<<event<<endl; cout<<"Your Balance: "<<rate<<endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue