Now You Code 1: Travel Companion

You're heading to Europe! Write a program which when you input an amount of money in USD will convert that to GBP (British Pounts) and EUR (Euro Dollars).

The program should use the API: http://fixer.io/ to calculate the exchange rates. You must read and review the API before beginning.

Example Run (Based on the exchange rates from 2017-03-06:

Enter the amount in USD you wish to exchange: 100
100.00 in USD is 94.41 in EUR
100.00 in USD is 81.48 in GBP

We will once again employ problem simplification. First you should write a function to get the exchange rates from fixer.io, then call that function in your main program.

Step 1: Problem Analysis get_exchange_rates

Inputs: None

Outputs: a dictionary of current exchange rates

Algorithm (Steps in Program):


In [1]:
# Step 2: write code here for the user-defined function get_exchange_rates

In [ ]:
# step 3: test the function
get_exchange_rates() # should output a dictionary of exchange rates

Step 4: Problem Analysis for entire program

Inputs:

Outputs:

Algorithm (Steps in Program):


In [1]:
# step 5: write main program

Step 6: Questions

  1. What happens when you enter mike as input? Which error to you get? Fix the program in step 4 so that it handles this error.

Answer:

  1. Put your laptop in Airplane mode (disable the wifi) and then run the program. What happens? Fix the program in step 4 so that it handles this error.

Answer:

Step 7: Reflection

Reflect upon your experience completing this assignment. This should be a personal narrative, in your own voice, and cite specifics relevant to the activity as to help the grader understand how you arrived at the code you submitted. Things to consider touching upon: Elaborate on the process itself. Did your original problem analysis work as designed? How many iterations did you go through before you arrived at the solution? Where did you struggle along the way and how did you overcome it? What did you learn from completing the assignment? What do you need to work on to get better? What was most valuable and least valuable about this exercise? Do you have any suggestions for improvements?

To make a good reflection, you should journal your thoughts, questions and comments while you complete the exercise.

Keep your response to between 100 and 250 words.

--== Write Your Reflection Below Here ==--