Visual Basic 6.0
Slip27
Q.1) Write a VB a program to accept a string from user if the string contain any integer
number that get replaced by *. [Marks 15]
Solution
Dim str As String
Dim s As String
Private Sub Command1_Click()
str = Text1.Text
s = Replace(str, "9", "*")
s = Replace(s, "8", "*")
s = Replace(s, "7", "*")
s = Replace(s, "6", "*")
s = Replace(s, "5", "*")
s = Replace(s, "4", "*")
s = Replace(s, "3", "*")
s = Replace(s, "2", "*")
s = Replace(s, "1", "*")
s = Replace(s, "0", "*")
MsgBox "string=" & s
End Sub
Output
Q.2) Write a menu driven program in VB for reservation & cancellation of tickets for a
theatre. The menu should also contain an option for displaying the reservation details.
The program should ask for the no. of tickets that the user wants to book and category
(balcony, upper & lower) (Use a List Box).Display no. of tickets booked, Category & total
amount. The reservation details should display no. of tickets booked at any instant of
time category-wise. [25 Marks]
Solution
Same As Slip14
Tags:
VB 6.0