Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CandyCount {
- public static void main(String[] args) {
- double RealMoney = 12.4;
- double RealPrice = 1.2;
- int Candies = 0;
- if (RealMoney > 0 && RealPrice > 0) {
- while ((RealMoney - RealPrice) >= 0 ) {
- Candies = Candies + 1;
- RealMoney = RealMoney - RealPrice;
- }
- }
- System.out.println(Candies);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement