Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MasterSami1985/08ecc147a766a007153f94bb40d03210 to your computer and use it in GitHub Desktop.
Save MasterSami1985/08ecc147a766a007153f94bb40d03210 to your computer and use it in GitHub Desktop.
Android for Beginners : If/Else Smoothie Quiz
int numberOfSmoothiesTillPrize = 10;
if (numberOfSmoothiesTillPrize > 9) {
Log.v("SmoothieActivity", "Congratulations, you get a free smoothie!");
numberOfSmoothiesTillPrize = numberOfSmoothiesTillPrize - 10;
} else {
Log.v("SmoothieActivity", "No free smoothie this time.");
}
Log.v("SmoothieActivity", "You currently have " + numberOfSmoothiesTillPrize + " out of 10 smoothies needed for your next free smoothie.");
@MasterSami1985
Copy link
Author

nice I solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment