Skip to content

Instantly share code, notes, and snippets.

@hiddendragonXVII
Created February 22, 2012 20:39
Show Gist options
  • Save hiddendragonXVII/1887103 to your computer and use it in GitHub Desktop.
Save hiddendragonXVII/1887103 to your computer and use it in GitHub Desktop.
justin's homework
#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