Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int froyoStamps = 0;
- while (1)
- {
- char userSelection = ' ';
- //print menu
- cout << "Press P to purchase Froyo" << endl;
- cout << "Press S to stop" << endl;
- cin >> userSelection;
- if (input == 'P' || input == 'p')
- {
- int froyoPurchase;
- //freebies
- if //(eligible for freebies)
- {
- char freeAnswer = ' ';
- cout << "You are eligible for a free yogurt." << endl;
- cout << "Would you like one? Yes/No: "
- cin >> freeAnswer;
- if (freeAnswer == 'y' || freeAnswer == 'Y')
- {
- stamps -= 10;
- }
- if (freeAnswer == 'n' || freeAnswer == 'N')
- {
- //go to transaction
- }
- //error check
- else ()
- {
- //error message
- //next loop pass
- }
- }
- //transaction
- cout << "How many Fro-yos would you like to buy: ";
- cin >> froyoPurchase;
- if (//froyoPurchase is a valid number)
- {
- continue to free item check
- }
- //transaction error check
- if invalid number
- {
- "you fucked up"
- exit
- }
- if if they aren't eligible for freebies
- {
- go back to menu
- }
- }
- if (input == 's' || input == 'S')
- {
- cout << "You pressed 'S'. Goodbye." << endl;
- //exit
- }
- else
- {
- cout << "ERROR." << endl;
- //exit
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement