Visual Basic 6.0

Visual Basic 6.0

Slip 10

Q.1) Write a VB program to convert temperature in Celsius to Fahrenheit and result should
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


BCA Pratical Solution

My name is Vivek And I from Mumbai and Complete my Graduation Bca.my Age is 23 Years.

Post a Comment

Previous Post Next Post