![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Apr 2005
Posts: 218
Rep Power: 4
![]() |
currency conversion program
I know its lame, but I had to think of somthing to do in a visual basic programming class.
This program only converts into 5 different currencys at the moment but ill add some more as and when I need them. I chose to make this program because im always looking for the currency conversions on goggle. Const RussianRoubleRate = 28.12124
Const CanadianDollarRate = 1.143958
Const EuroRate = 0.822647
Const SouthKoreanWonRate = 1708.76
Const ThaiBahtRate = 68.6
Dim result As Double
Private Sub Form_Load()
'List of the currencys to be used in the list box
Combo1.AddItem ("Russian Rouble")
Combo1.AddItem ("Canadian Dollar")
Combo1.AddItem ("Euro")
Combo1.AddItem ("South Korean Won")
Combo1.AddItem ("Thai baht")
End Sub
Private Sub Command7_Click()
'Adds the numbers together
If Combo1.ListIndex = 0 Then 'Selects the appropiate exchange rate
If Text2.Text <> "" Then
result = Val(Text2.Text) * RussianRoubleRate
Text1.Text = result
Else
MsgBox ("no value to convert") 'Displays message box telling the user that they
End If 'have not entered any data
End If
If Combo1.ListIndex = 1 Then 'Selects the appropiate exchange rate
If Text2.Text <> "" Then
result = Val(Text2.Text) * CanadianDollarRate
Text1.Text = result
Else
MsgBox ("no value to convert")
End If
End If
If Combo1.ListIndex = 2 Then 'Selects the appropiate exchange rate
If Text2.Text <> "" Then
result = Val(Text2.Text) * EuroRate
Text1.Text = result
Else
MsgBox ("no value to convert")
End If
End If
If Combo1.ListIndex = 3 Then 'Selects the appropiate exchange rate
If Text2.Text <> "" Then
result = Val(Text2.Text) * SouthKoreanWonRate
Text1.Text = result
Else
MsgBox ("no value to convert")
End If
End If
If Combo1.ListIndex = 4 Then 'Selects the appropiate exchange rate
If Text2.Text <> "" Then
result = Val(Text2.Text) * ThaiBahtRate
Text1.Text = result
Else
MsgBox ("no value to convert")
End If
End If
End Sub
Private Sub Image1_Click()
End Sub |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Nice, i was gonna make one but the problem is the conversion rate is always changing
|
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
Try adding an update option to the program, so the program can take the new conv rates from the web( from an e-bank, for example ).
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Apr 2005
Posts: 218
Rep Power: 4
![]() |
Yeah, I thought about having ot updated from the web. Anyway it was just for a college project and a mainly learning C++ so ill do the same kind of thing but in C++
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|