Remember to checkout the Codesnip below to review the C++ code yourself! Feel free to copy the code, but I ask that you please provide credit if you leave the code unchanged when you use it.
//Programmer: Nazmus //Program: Switch Statement //Website: EasyProgramming.net #include <iostream> using namespace std; void main() { char age; cout << "Pleaes enter letter associated with your age: \n" "(A) 17 years and below \n" "(B) 18 years to 64 years \n" "(C) 65 years and above \n" << endl; cin >> age; cout << "The ticket will cost you: "; switch (age){ case 'a' : case 'A' : cout << "$10"; break; case 'b': case 'B' : cout << "$20"; break; case 'c': case 'C' : cout << "$15"; break; default : cout << "Invalid entry"; break; } cout << endl; system("pause"); }