Update 02-currency/README.md
This commit is contained in:
parent
4d75bca7c1
commit
4d84e0c189
@ -1,11 +1,13 @@
|
||||
Float to Currency
|
||||
==================
|
||||
|
||||
Write a method that gives the number of American coins and bills needed to represent that number (rounded to the nearest 1/100, i.e. the nearest penny).
|
||||
Write a method that gives the number of currency coins and bills needed to
|
||||
represent that number (rounded to the nearest 1/100, i.e. the nearest coin).
|
||||
|
||||
As an exmaple, if the float is 12.33, the result would be 1 $10, 2 $1 bills, 1 quarter, 1 nickel and 3 pennies.
|
||||
As an exmaple, if the float is 12.33, the result would be 1 $10, 2 $1 bills,
|
||||
1 quarter, 1 nickel and 3 pennies.
|
||||
|
||||
Use the following as denominations for your currencies:
|
||||
Here is the the list USD banknotes. Feel free to use USD or you local currency.
|
||||
|
||||
Penny: 1 cent
|
||||
Nickel: 5 cent
|
||||
@ -14,5 +16,25 @@ Use the following as denominations for your currencies:
|
||||
One-dollar bill
|
||||
Five-dollar bill
|
||||
Ten-dollar bill
|
||||
Twenty-dollar bill
|
||||
Fifty-dollar bill
|
||||
Hundred-dollar bill
|
||||
|
||||
|
||||
## Bonus
|
||||
|
||||
Write a second function to make the output look nice, something like this:
|
||||
|
||||
```
|
||||
currency_converter_formater(12.23)
|
||||
|
||||
Penny: 3
|
||||
Dime: 2
|
||||
One-dollar: 2
|
||||
Ten-dollar: 1
|
||||
```
|
||||
|
||||
# Bonus II
|
||||
|
||||
Abjust your function so it takes a second argument of `denominations` so a
|
||||
single currency is not hard coded.
|
||||
|
Loading…
x
Reference in New Issue
Block a user