For the following exercises, use the incremental development methodology to implement the program. For each exercise, identify the program tasks, create a design document with class descriptions, and draw the program diagram. Map out the development steps at the start. Present any design alternatives and justify your selection. Be sure to perform adequate testing at the end of each development step.
Design a currency converter class whose instance will handle conversion of all currencies. A single instance of the new currency converter class you design here will handle all currencies. Instead of having specific conversion methods such as toDollar, toYen, and so forth, the new currency converter class supports one generic conversion method called exchange. The method has three arguments: fromCurrency, toCurrency, and amount. The first two arguments are String and give the names of currencies. The third argument is float. To convert $250 to yen, we write
yen = converter.exchange( "dollar", "yen", 250.0 );
To set the exchange rate for a currency, we use the setRate method. This method takes two arguments: The first argument is the currency name, and the second argument is the rate. For example, if the exchange rate for yen is 140 yen to $1, then we write
converter.setRate( "yen", 140.0 );
Use an array to keep track of exchange rates.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.