Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 1st, 2006, 11:30 AM   #1
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
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
zorin is offline   Reply With Quote
Old Feb 1st, 2006, 2:13 PM   #2
HaCkeR
Hobbyist Programmer
 
HaCkeR's Avatar
 
Join Date: Nov 2005
Location: UK
Posts: 131
Rep Power: 0 HaCkeR is an unknown quantity at this point
Send a message via AIM to HaCkeR Send a message via MSN to HaCkeR
Nice, i was gonna make one but the problem is the conversion rate is always changing
HaCkeR is offline   Reply With Quote
Old Feb 1st, 2006, 3:03 PM   #3
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
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 ).
ivan is offline   Reply With Quote
Old Feb 1st, 2006, 5:25 PM   #4
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
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++
zorin is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC