Hi
I do not understand what I am supposed to to do on Task 6. What am I supposed to do after calculating the actual exchange rate? What am I supposed to do with the budget and denomination variables? The hint says to do something with division, but I don’t know what to divide. I don’t understand it at all. Please help.
def exchange_money(budget, exchange_rate):
"""
:param budget: float - amount of money you are planning to exchange.
:param exchange_rate: float - unit value of the foreign currency.
:return: float - exchanged value of the foreign currency you can receive.
"""
exchange_rate = budget / exchange_rate
return exchange_rate
def get_change(budget, exchanging_value):
"""
:param budget: float - amount of money you own.
:param exchanging_value: float - amount of your money you want to exchange now.
:return: float - amount left of your starting currency after exchanging.
"""
change = budget - exchanging_value
return change
def get_value_of_bills(denomination, number_of_bills):
"""
:param denomination: int - the value of a bill.
:param number_of_bills: int - total number of bills.
:return: int - calculated value of the bills.
"""
value = denomination * number_of_bills
return value
def get_number_of_bills(amount, denomination):
"""
:param amount: float - the total starting value.
:param denomination: int - the value of a single bill.
:return: int - number of bills that can be obtained from the amount.
"""
number_of_bills = amount // denomination
return number_of_bills
def get_leftover_of_bills(amount, denomination):
"""
:param amount: float - the total starting value.
:param denomination: int - the value of a single bill.
:return: float - the amount that is "leftover", given the current denomination.
"""
leftover_of_bills = amount % denomination
return leftover_of_bills
def exchangeable_value(budget, exchange_rate, spread, denomination):
"""
:param budget: float - the amount of your money you are planning to exchange.
:param exchange_rate: float - the unit value of the foreign currency.
:param spread: int - percentage that is taken as an exchange fee.
:param denomination: int - the value of a single bill.
:return: int - maximum value you can get.
"""
exchange_rate = budget / exchange_rate
spread = exchange_rate * spread / 100
actual_rate = exchange_rate + spread