Created
February 22, 2012 20:39
-
-
Save hiddendragonXVII/1887103 to your computer and use it in GitHub Desktop.
justin's homework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int getHamburgers(){ | |
char more = 'Y'; | |
int total=0; | |
int numberBurgers = 0; | |
while(true){ | |
cout << "Enter number of burgers wanted"<<endl; | |
cin >> numberBurgers; | |
total+=numberBurgers; | |
cout << "More Hamburgers? y/n"<<endl; | |
cin >> more; | |
if (more=='N'||more=='n'){ | |
return 0; | |
} | |
} | |
} | |
int main() | |
{ | |
int hamburgers =getHamburgers(); | |
cout << "Total:"<< hamburgers<<endl; | |
system("PAUSE"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment