Visual Basic 6.0
Slip 10
display into message box. (Accept input through input box) [Marks 15]
Solution
Dim f As Double
Dim c As Integer
Private Sub Command1_Click()
c = Val(InputBox("enter celsius"))
f = (9 * 0.5) * c + 32
MsgBox ("fahrenheait:" & f)
End Sub
Output
![]() |
Fahrenheit |
Q.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)
[Marks 25]
Solution
Private Sub Command1_Click()
Text2.Text = Val(Text1.Text) / 1.5
End Sub
Private Sub Command2_Click()
Text2.Text = Val(Text1.Text) / 71.14
End Sub
Private Sub Command3_Click()
Text2.Text = Val(Text1.Text) / 91.57
End Sub
Private Sub Command4_Click()
Text2.Text = Val(Text1.Text) / 81.15
End Sub
Output
Tags:
VB 6.0