Forked from udacityandroid/Code snippet in SmoothieActivity.java
Created
February 11, 2018 21:37
-
-
Save ehab18/a19f6d244b86fd73c04581d6351ee42d to your computer and use it in GitHub Desktop.
Android for Beginners : If/Else Smoothie Quiz
This file contains hidden or 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
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."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment