Advertisement
Guest User

Untitled

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