Advertisement
quantumech

Untitled

Oct 16th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # This is in Python, you have to translate it into java yourself. I don't wanna spoil Ms Engels course for you lolol (Its also good to learn multiple languages. Makes you a better programmer if you can think from multiple perspectives. I would recommend reimplementing your assignments in other languages such as Python, C, etc)
  2.  
  3. # money = [cents, nickels, dimes, quarters] (You dont have to use an array but I am so yeah deal with it :P)
  4.  
  5. from math import floor
  6.  
  7. money[3] = floor(cents/25)
  8. cents %= 25
  9. money[2] = floor(cents/10)
  10. cents %= 10
  11. money[1] = floor(cents/5)
  12. cents %= 5
  13. money[0] = cents
  14.  
  15. print(money)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement