Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.31 KB | None | 0 0
  1. // Cola Machine. Online Excersises
  2.  
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int answer;
  11.    
  12.    
  13.  
  14.     cout << "Hello! Welcome to MyVending! \n";
  15.     cout << "Select your beverage by entering the number for the beverage \n";
  16.     cout << "\n";
  17.     cout << "#1) Coca-Cola  \n";
  18.     cout << "#2) Dr. Pepper \n";
  19.     cout << "#3) Sprite     \n";
  20.     cout << "#4) Diet Coke  \n";
  21.     cout << "#5) Fanta      \n";
  22.     cout << "\n";
  23.        
  24.     cin >> answer;
  25.    
  26.        
  27.         switch (answer)
  28.         {
  29.                case 1:
  30.                     cout << "Thank You. Enjoy Your Coke!";
  31.                     break;
  32.                case 2:
  33.                     cout << "Thank You. Enjoy Your Dr. Pepper!";
  34.                     break;
  35.                case 3:
  36.                     cout << "Thank You. Enjoy Your Sprite!";
  37.                     break;
  38.                case 4:
  39.                     cout << "Thank You. Enjoy Your Diet Coke!";
  40.                     break;
  41.                case 5:
  42.                     cout << "Thank You. Enjoy Your Fanta!";
  43.                     break;
  44.                default:
  45.                     cout << "Sorry. Please Enter A number next to the beverage you want.";
  46.    
  47.         }
  48.  
  49.     int pause;/
  50.     cin >> pause;
  51.    
  52.     return 0;
  53.    
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement