Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char y;
- cout << "Please select your beverage\n";
- cout << "1: Coke\n2: Pepsi\n3: Water\n4: Lucozade\n5: Sprite\n";
- cin >> y;
- switch (y)
- {
- case '1':
- cout << "You have chosen Coke!\n";
- break;
- case '2':
- cout << "You have chosen Pepsi!\n";
- break;
- case '3':
- cout << "You have chosen Water!\n";
- break;
- case '4':
- cout << "You have chosen Lucozade!\n";
- break;
- case '5':
- cout << "You have chosen Sprite!\n";
- break;
- default:
- cout << "I don't know what that is\n";
- break;
- return 0;
- }
- }
Add Comment
Please, Sign In to add comment