Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pastebin | #1 paste tool since 2002
- create new paste
- tools
- api
- archive
- real-time
- faq
- pastebin
- create new paste
- trending pastes
- sign up
- login
- my settings
- my profile
- My Pastes
- Public Pastes
- Untitled1 sec ago
- indian escort in Dubai ...9 sec ago
- Untitled7 sec ago
- Naval ORBAT (N)16 sec ago
- Untitled13 sec ago
- Untitled19 sec ago
- Updated Version :DC++ | 24 sec ago
- Untitled24 sec ago
- Layout Width
- Share Pastebin
- Guest
- Public paste!
- Updated Version :D
- By: a guest | Feb 14th, 2012 | Syntax: C++ | Size: 1.42 KB | Hits: 6 | Expires: Never
- Download | Raw | Embed | Report abuse
- This paste has a previous version, view the difference. Copy text to clipboard
- // Soda Machine.cpp
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main() {
- int choose;
- int option;
- bool done = false;
- while (done = false)
- cout << endl;
- cout << " Hello and welcome to the Beverage Machine." << endl;
- cout << endl;
- cout << "We have five diffrent sodas." << endl;
- cout << "Press 1 for Coke-a-Cola." << endl;
- cout << "Press 2 for Sprite." <<endl;
- cout << "Press 3 for Monster." << endl;
- cout << "Press 4 for Water." << endl;
- cout << "Press 5 for Pepsi." << endl;
- cout << "Choose which drink you want: ";
- cin >> choose;
- if (choose == 1)
- cout << "You choose Coke-a-Cola. Nice chooce." << endl;
- else if (choose == 2)
- cout << "You choose Sprite. Nice choose." << endl;
- else if (choose == 3)
- cout << "You choose Monster. Nice choose." << endl;
- else if (choose == 4)
- cout << "You choose Water. Trying to loose weight?" << endl;
- else if (choose == 5)
- cout << "You choose Pepsi. I love pepsi." << endl;
- else
- cout << "Sorry, that was an Invalid input. Heres your money back." << endl;
- cout << "Press 1 to order another drink. Press 2 to leave the soda machine: ";
- cin >> option;
- if (option == 1)
- done = false;
- else if(option == 2)
- done = true;
- else
- cout << "Invalid Input." << endl;
- cin.get();
- return 0;
- }
Add Comment
Please, Sign In to add comment