Timeline for Converting Java int-based amount to Coin metrics
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 10, 2013 at 4:47 | comment | added | bowmore |
QuotientAndRemainder is a static class because I made it an inner class, which is not strictly necessary. divide() and minimalChange() pertain to an amount of pennies just as your original convert() method does. If your input would be an amount of coins then the Coin enum could also be given an 'int toPennies()' method. For my full code see ideone.com/jD666U
|
|
Sep 9, 2013 at 23:47 | comment | added | PacificNW_Lover | bowmore - Thank you for the valuable feedback! Your divide method inside the QuotientAndRemainder static class only pertains to pennies as does the minimalChange() method. How can I use this for other types of coins? Also, can you show me an example of how I can use these helper classes inside perhaps a main() method? | |
Sep 9, 2013 at 21:31 | history | answered | bowmore | CC BY-SA 3.0 |