#currency exchange exercise
21 messages · Page 1 of 1 (latest)
i dont understand how this helps
eventhough i did manage to solve task 3
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.
yeah but i dont understand the instructions
for task 3 i simply multiplied the 2 parameters and it worked
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.'
Remember that the currency denomination is a whole number, and cannot be sub-divided.'
i didnt get this part
'This function should return the maximum value of the new currency after calculating the exchange rate plus the spread.
i got this part
Perhaps, it's because the amount you can receive varies depending on the denomination of the bills?
but what does denomination do exactly?
do i subtract the denomination number?
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.
Ok ok
I got it thank you
I couldn't explain it very well, but I wish you success.
@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.
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.