So recently I made a code for the CASH project in CS50, but for some reason its giving me wrong values for the total amount of coins when I think the code is correct. I posted my code down below, could you guys look through it and search for errors? For example, when I put in the value (0.41), I get 3 coins, when the correct value is 4, but for other values such as (0.20), I get the correct value of 2. Thanks! Here is a link to a picture of the code: https://gyazo.com/8730583eaecf4b8bc8c396edd48fce04
1 Answer
Take a look at the walkthrough for this problem. In the video, Zamyla talks about converting units used in the code and rounding them for the program to work as intended.
Good luck!