Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public class CandyCount {
  2.  
  3. public static void main(String[] args) {
  4. double RealMoney = 12.4;
  5. double RealPrice = 1.2;
  6. int Candies = 0;
  7.  
  8. if (RealMoney > 0 && RealPrice > 0) {
  9. while ((RealMoney - RealPrice) >= 0 ) {
  10. Candies = Candies + 1;
  11. RealMoney = RealMoney - RealPrice;
  12. }
  13. }
  14. System.out.println(Candies);
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement