Created
September 10, 2018 15:31
-
-
Save Skoatpalace/017c7fcf0a1abe03e0885986ec51b9e3 to your computer and use it in GitHub Desktop.
CandyCount.java
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
class candyCount { | |
public static void main(String[] args) { | |
double HaveMoney = 12.4; | |
double IsPrice = 1.2; | |
int NbCandies = 0; | |
if ((HaveMoney > 0) && (IsPrice > 0)) { | |
while ((HaveMoney - IsPrice) >= 0) { | |
NbCandies = (NbCandies + 1); | |
HaveMoney = (HaveMoney - IsPrice); | |
} | |
} | |
System.out.println(NbCandies); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment