#currency exchange exercise

21 messages · Page 1 of 1 (latest)

dapper juniper
#

If you are solving the Python, Currency Exchange, Task 3 instructions might be helpful.

sterile cradle
#

i dont understand how this helps

sterile cradle
dapper juniper
#

The instructions for Task 3 say:
'This exchanging booth only deals in cash of certain increments. The total you receive must be divisible by the value of one "bill" or unit, which can leave behind a fraction or remainder. Your function should return only the total value of the bills (excluding fractional amounts) the booth would give back. Unfortunately, the booth gets to keep the remainder/change as an added bonus.

sterile cradle
#

yeah but i dont understand the instructions

sterile cradle
dapper juniper
#

The instructions for Task 6 say:
'This function should return the maximum value of the new currency after calculating the exchange rate plus the spread. Remember that the currency denomination is a whole number, and cannot be sub-divided.'

sterile cradle
sterile cradle
dapper juniper
sterile cradle
#

but what does denomination do exactly?

sterile cradle
dapper juniper
#

I'm sorry. I can't explain it any better. Anyway, the maximum amount you can receive at the exchange booth varies depending on the denomination of the bills.

#

In the input example, it says (127.25, 1.20, 10, 20).

budget = 127.25
exchange_rate = 1.20
spread = 10
denomination = 20

Normally, if the exchange_rate = 1.20 and the spread = 10, the calculation would result in 96.4015... that can be received, but the output example for denomination = 20 is 80. This is because 80 is a multiple of 20.
The output example for denomination = 5 is 95. This is because 95 is a multiple of 5.

sterile cradle
#

Ok ok

dapper juniper
#

I couldn't explain it very well, but I wish you success.

tardy fossil
#

@sterile cradle It explains in the exercise that the denomination : is the value of the bill, in layman term, it is the number on the piece of paper.

marsh kayak
#

If you ask a bank machine to give you money but they only give out $20 bills, that effects how much money you can get. You can get 20 or 40 but not 30 or 35.

sterile cradle
#

Don't worry I got it

#

Thanks for helping though