Advertisement
Guest User

Untitled

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