Last active
May 9, 2019 10:42
-
-
Save Morzanne/e6753b449cba80ae98ac41fb8ce899e5 to your computer and use it in GitHub Desktop.
Java quest algo
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
public class CandyCount{ | |
public static void main(String[] args) { | |
float money = 12.4f; | |
float price = 1.2f; | |
int candies = 0; | |
if(money>0 && price >0){ | |
while(money - price >=0){ | |
candies=candies + 1; | |
money = money - price; | |
} | |
} | |
System.out.println(candies); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment