Guest User

Untitled

a guest
Jun 24th, 2018
1,176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. pastebin | #1 paste tool since 2002
  2.  
  3. create new paste
  4. tools
  5. api
  6. archive
  7. real-time
  8. faq
  9.  
  10. pastebin
  11.  
  12. create new paste
  13. trending pastes
  14.  
  15. sign up
  16. login
  17. my settings
  18. my profile
  19.  
  20. My Pastes
  21. Public Pastes
  22.  
  23. Untitled1 sec ago
  24. indian escort in Dubai ...9 sec ago
  25. Untitled7 sec ago
  26. Naval ORBAT (N)16 sec ago
  27. Untitled13 sec ago
  28. Untitled19 sec ago
  29. Updated Version :DC++ | 24 sec ago
  30. Untitled24 sec ago
  31.  
  32. Layout Width
  33. Share Pastebin
  34. Guest
  35. Public paste!
  36. Updated Version :D
  37. By: a guest | Feb 14th, 2012 | Syntax: C++ | Size: 1.42 KB | Hits: 6 | Expires: Never
  38. Download | Raw | Embed | Report abuse
  39. This paste has a previous version, view the difference. Copy text to clipboard
  40.  
  41. // Soda Machine.cpp
  42. #include "stdafx.h"
  43. #include <iostream>
  44. using namespace std;
  45.  
  46. int main() {
  47.  
  48. int choose;
  49. int option;
  50. bool done = false;
  51. while (done = false)
  52.  
  53. cout << endl;
  54. cout << " Hello and welcome to the Beverage Machine." << endl;
  55. cout << endl;
  56. cout << "We have five diffrent sodas." << endl;
  57. cout << "Press 1 for Coke-a-Cola." << endl;
  58. cout << "Press 2 for Sprite." <<endl;
  59. cout << "Press 3 for Monster." << endl;
  60. cout << "Press 4 for Water." << endl;
  61. cout << "Press 5 for Pepsi." << endl;
  62. cout << "Choose which drink you want: ";
  63. cin >> choose;
  64.  
  65. if (choose == 1)
  66. cout << "You choose Coke-a-Cola. Nice chooce." << endl;
  67. else if (choose == 2)
  68. cout << "You choose Sprite. Nice choose." << endl;
  69. else if (choose == 3)
  70. cout << "You choose Monster. Nice choose." << endl;
  71. else if (choose == 4)
  72. cout << "You choose Water. Trying to loose weight?" << endl;
  73. else if (choose == 5)
  74. cout << "You choose Pepsi. I love pepsi." << endl;
  75. else
  76. cout << "Sorry, that was an Invalid input. Heres your money back." << endl;
  77. cout << "Press 1 to order another drink. Press 2 to leave the soda machine: ";
  78. cin >> option;
  79. if (option == 1)
  80. done = false;
  81. else if(option == 2)
  82. done = true;
  83. else
  84. cout << "Invalid Input." << endl;
  85.  
  86.  
  87.  
  88. cin.get();
  89. return 0;
  90. }
Add Comment
Please, Sign In to add comment