Wednesday, December 3, 2014

Alternative


So my off-line currency converter does work, for the four currencies required: 
CAD, GBP, EUR and USD. But the coding cost is high on my first model.
There are sixteen cases to be defined for the switch statement:



Then a much more economical way dawned on me: just create a two-dimensional array with the 
exchange values, and access the relevant case as the array index. This is going to work!!


No comments: