Advertisement
Guest User

Untitled

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