VBSlip 10_2_2015-16



=================================Slip10_2===================================
Write a VB program for currency conversion. The program should input the amount in any currency and the output should be displayed in the desire currency as selected by the user. An input form should accept all the currency rates. The various currencies are rupee, dollar, pound and euro.  (Use textbox control for input and to display output also) ==========================================================================
 


Dim pound As Integer

Dim dollar As Integer
Dim euro As Integer

Private Sub cmdConvert_Click()
               
                If Option1.Value = True Then
                                Label2.Caption = "Dollar"
                                Text2.Text = Val(Text1.Text) / dollar
                ElseIf Option2.Value = True Then
                                Label2.Caption = "Pound"
                                Text2.Text = Val(Text1.Text) / pound
                ElseIf Option3.Value = True Then
                                Label2.Caption = "Euro"
                                Text2.Text = Val(Text1.Text) / euro
                Else
                                MsgBox ("Select Conversion type")
                End If
               
End Sub
Private Sub cmdRates_Click()
               
                pound = Val(InputBox("Enter Rate of pound"))
                dollar = Val(InputBox("Enter Rate of Dollar"))
                euro = Val(InputBox("Enter Rate of euro"))
                cmdConvert.Enabled = True
               
End Sub
Private Sub Form_Load()
                cmdConvert.Enabled = False
End Sub
 



2 comments:

Note: only a member of this blog may post a comment.