Homework 1 CMP12a Winter 2002 Ira Pohl

Due 1/14/2002, before midnight.

This assignment is ungraded, but you are still required to do it.

Converting Currency

Now that Europe has converted to the Euro we wish to provide a program that tells how to convert from Euros to dollars
and vice versa. We will write a program to find Euro to Dollars and Dollars to Euros for several values.

Assume that each Euro is worth $0.87. We want to know how many dollars 15, 200, and 1000 Euros convert to. We
also want to know how many Euros 15, 100, and 800 dollars convert to.

The formulas for these conversions are simple, but you should hand check them so that you are sure the program is correct. Also look at how the MakeChange program is structured in the text and follow its style. Remember documentation is 30% of the score on the graded homework.

This program is about simple mathematical expressions and nicely designed outpout. Make sure that your output is readable and easily understood by a user. Having a program output 87 and otherwise be silent would be poor practice. Having it output that "100 Euros converts to 87 dollars." is readily understood.

Keep in mind that you should code your java program and debug its logic before coming to the terminal. The computer is more for getting minor details right. We will do this problem with integer variables; so the answers will be truncated to the nearest whole dollar or Euro. You can assume that the bank keeps this difference as part of its fees.