SI204 Lab 3

  1. Write a program that converts between Dollars, Euros and Pounds. The program reads input from the user in the following format: Convert amount currency_1 to currency_2 and prints results in the obvious way. Here are a couple of sample runs:

    
    Command: Convert 3.50 Euros to Dollars
    Results: 3.43683
    		    
    
    Command: Convert 3.50 Euros to Pounds
    Results: 2.2171
    		    

    Here are the conversion rates you'll need: 1.00 Dollar is 1.01838 Euros and 1.00 Dollar is 0.64510 Pounds.

  2. Extend your program from Part 1 to allow for Canadian dollars as well (1.00 Dollar US is 1.55870 Dollars Canadian). Now the user can't simply put "Dollar" in the input, it must be either "Dollar US" or "Dollar Canadian". Here are a couple of sample runs:

    
    Command: Convert 3.50 Euros to Dollars US
    Results: 3.43683
    			  
    
    Command: Convert 11.72 Dollars US to Dollars Canadian
    Results: 18.268
    			  

  3. It's often nice to write programs that produce output that's intended for other programs. You will write a program that reads in three points from the user and prints output that the user can cut-and-paste into Excel to produce a plot showing the triangle defined by the three user-input points along with its bounding box, i.e. the smallest rectangle aligned with the coordinate axes that contains the triangle. (You should probably look at this info on using Excel to plot points.) Here's a sample run of the program:

    And here's the plot that is produced by Excel with that data: