# Sarah Buchanan
# May 23, 2012
# This program determines how much US currency is remaining after spending
# some foreign currency


def main():
    
    # Read in the user's US currency, the exchange rate,
    # and the amount of foreign currency spent.
    usCurrency = float(input("How many US dollars are you exchanging?"))
    xRate = float(input("What is the exchange rate from US dollars to foreign currency?"))
    forCurrency = float(input("How much foreign currency did you spend?"))

    # Determine total foreign currency after 2$ fee and spending
    totalFor = (usCurrency - 2)*xRate
    totalFor = totalFor-forCurrency

    # Convert back to US dollars
    totalUS = totalFor/xRate

    print("You will be left with $%.2f" %totalUS, " US currency.")

main()

