Timeline for pset1 Greedy Algorithm
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 25, 2017 at 0:34 | vote | accept | ncubed | ||
Jan 3, 2017 at 0:23 | history | edited | Cliff B | CC BY-SA 3.0 |
added 462 characters in body
|
Jan 2, 2017 at 23:20 | comment | added | Cliff B | Think about it. The code multiplies .43 * 100 and then subtracts 25. That leaves 18. Unfortunately, that's not the number of coins. Also, depending on the starting number, sometimes the issues I described will happen, other times they won't. Try $4.20 | |
Jan 2, 2017 at 23:05 | vote | accept | ncubed | ||
Jan 2, 2017 at 23:05 | |||||
Jan 2, 2017 at 23:02 | comment | added | ncubed | First off, thank you so much for your feedback. Prior to seeing your response, I had only changed the binary op. and the code gave me the expected output. I entered change at .43 cents and it returned an int of 18? Im not sure why though? | |
Jan 2, 2017 at 22:43 | history | answered | Cliff B | CC BY-SA 3.0 |