Now You Code In Class: Exchange Rates

You have been tasked with writing a program to help employees of a travel company convert currency.

The company travels to the following places. Next to the place is the exchange rate.

  • Europe: 1 US Dollar == 0.9 Euro
  • China: 1 US Dollar == 7.2 Chineese Yuan
  • Russia: 1 US Dollar == 64.2 Russian Ruble

You should write a program to input the amount of currency in US Dollars, and then input the place (either Europe, China, or Russia).

The program should then output the appropriate amount of exchanged currency.

Example Run 1:

Enter the amount of Currency in US Dollars: $100
Enter the place you are travelling: Europe, China or Russia? China

$100.00 US Dollars is $720.00 Chineese Yuan

Step 1: Problem Analysis

Inputs:

Outputs:

Algorithm (Steps in Program):


In [1]:
# Step 2: Write code here

Part Two

After you get that working, re-write the program to account for bad input, such as the case where you enter a non-numerical value for US Dollars, or when you enter a place other than the three accepted locations.

Example Run 2:

Enter the amount of Currency in US Dollars: A hundo

'A Hundo' is not a valid amount!

Example Run 2:

Enter the amount of Currency in US Dollars: $100
Enter the place you are travelling: Europe, China or Russia? Canada

Sorry. You cannot travel to 'Canada' at this time

In [ ]:
# Part 2: Write entire solution here