To Projects
IT 236 -- Currency Converter Project
 
Goal:   Write an Windows application that can convert one of
the currencies Dollar, Pound, Euro, Yen or Ruble to one of the other
currencies.
- On June 12, 2006 the value of one unit of each of these
currencies in dollars was 1.00000, 1.84065, 1.25771, 0.00873107,
0.0369836, respectively.
- Your application should have three textboxes for input labeled
Source Currency, Target Currency and Source Amount. It should have
one textbox for output labeled Target Amount. It should have a button
with the caption Convert Currency.
- When the Convert Currency button is clicked, the Click event handler
for that button should compute the target amount and display the flag
associated with the target amount in a picture box. You can use these
flag images:
dollar.gif
pound.gif
euro.gif
yen.gif
ruble.gif
- Use this pseudocode to obtain the source rate:
If sourceCurrency is Dollar Then
Assign sourceRate to 1.00000
ElseIf sourceCurrency is Pound Then
Assign sourceRate to 1.84065
ElseIf sourceCurrency is Euro Then
Assign sourceRate to 1.25771
ElseIf sourceCurrency is Yen Then
Assign sourceRate to 0.00873107
ElseIf sourceCurrency is Ruble Then
Assign sourceRate to 0.0369836
End If
Use similar pseudocode to obtain the target rate. At the same time
you set the target rate, display the flag corresponding to the target
currency.
- Use this formula to compute the target amount:
targetAmount | = |
(sourceAmount)(sourceRate) |
|
targetRate |
|
- Use the following statement to round off the target amount:
txtTargetAmount.Text = targetAmount.ToString("#,##0.0000")
Some Hints
- Here is the beginning of the translation from pseudocode into VB:
If sourceCurrency = "Dollar" Then
sourceRate = 1.00000
picSourceFlag.Image = Image.FromFile("dollar.gif")
ElseIf sourceCurrency = "Pound" Then
sourceRate = 1.84065
picSourceFlag.Image = Image.FromFile("pound.gif")
.......
-