Last active
August 29, 2015 14:03
-
-
Save KronicDeth/c54b68a513b8574296d3 to your computer and use it in GitHub Desktop.
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> // includes and statements section | |
using std::cin; // user input | |
using std::cout; // machine output | |
using std::endl; // for line breaks | |
int main () { | |
int coupons; | |
cout << "How many coupons did you win?" << endl; | |
cin >> coupons; | |
cout << "You entered " << coupons << " coupons." << endl; | |
int candyBars; | |
candyBars = (coupons / 10); | |
cout << "You can get " << candyBars << " candy bars!" << endl; | |
int remainder; | |
remainder = (coupons % 10); | |
int gumballs; | |
gumballs = (remainder / 3); | |
int remainderGum; | |
remainderGum = (remainder % 3); | |
cout << "You can get " << gumballs << " gumballs!" << endl; | |
cout << "You will have " << remainderGum << " coupons left!" << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment