# pset1 trouble in understanding greedy concept

i don't get this greedy thingy, because i don't know what are these nickles, pennies, cents :confused: what do? However i am just amusing that its about something we to do with rounding floating numbers. Could anyone please explain it to me? Thanks

Good question in an international teaching environment. U.S. currency is based on the Dollar, as you have probably learned at some point. We also have coins that represent a fraction of \$1 (one dollar). They are:

``````penny    \$ 0.01  (also known as a cent - 100 cents = 1 dollar)
nickel   \$ 0.05
dime     \$ 0.10
quarter  \$ 0.25
``````

We have other coins, but for the purpose of this pset, you do not need to worry about them.

The assignment is indeed about rounding of floats, and, more importantly, about how floats are stored in a computer, but not perfectly accurately. This pset will demonstrate that if you don't handle floats correctly, you will lose accuracy.

The assignment, simply put, is this: You are given a number such as \$2.35 (two dollars and 35 cents). What is the minimum number of the coins listed above needed to make that amount? Note: it just has to output the minimum number of physical coins, not the number of each or any other variation.

In this case, \$2.35, it would be 10 coins - 9 quarters and 1 dime. It's that simple. Input would always have no more than 2 decimal points, maybe 1 or maybe none. Your job is to figure out a program to calculate the minimum number of coins. That's it!

What you have to do is read a `float` that will represent the dollars (for example `3.15`, note that the dollar sign will not be included). Then you need to convert that to cents, and then output the minimum number of coins needed to give that amount to the user.