Visual Basic VB Record
Visual Basic VB Record
Visual Basic VB Record
CERTIFICATE
Examiners:
1)
2)
INDEX
1 CHECK PROFILE
2 BINARY SEARCH
3 STACK OPERATIONS
4 LIST OPERATIONS
6 CALCULATOR
10 ELECTRICITY BILL
12 TRAFFIC SIGNALS
13 CREATING MENUS
Private Subadd_Click()
If List1.ListCount <> 3 Then
List1.AddItem Combo3.Text
Else
MsgBox "maximum three skills to be choosed"
End If
End Sub
Private Subclear_Click()
Text1.Text = " "
Option1.Value = False
Option2.Value = False
Combo1.Text = " "
Combo2.Text = " "
Combo3.Text = " "
Combo4.Text = " "
Check1.Value = False
Check2.Value = False
Check3.Value = False
Check4.Value = False
List1.CLEAR
End Sub
Private Subclose_Click()
Unload Me
End Sub
Private Subsubmit_Click()
MsgBox (Text1.Text & " " & "your data has been submitted")
End Sub
5. Now the save the project and run the form by pressing F5 key
OUTPUT :
2. VB program to find an element in a list using binary search.
1.start VB and create anew standardEXE project.
2.place the required controls on the form and set the
properties as required.
3. Design the form as shown.
Option Explicit
Dim x(1 To 10) As Integer, n As Integer, I As Integer, j
As Integer, k As Integer, m As Integer, h As Integer, l As
Integer
OUTPUT:
4. VB application for coping the elements from one list to other list
and vice-versa.
1. start VB and create a new standardEXE project.
2. create the command buttons and set the properties as required.
3. click on codeview and write the following code.
Private Sub Command1_Click()
List2.AddItem List1.Text
List1.RemoveItem List1.ListIndex
List1.Text = Clear
End Sub
Public n As Integer
Public age As Integer
Public a As Integer, b As Integer, c As Integer, m As Integer
Public Sub calculate(age As Integer)
If age >= 25 And age <= 34 Then
a=a+1
ElseIf age >= 35 And age <= 44 Then
b=b+1
ElseIf age >= 45 And age <= 54 Then
c=c+1
ElseIf age >= 55 Then
m=m+1
End If
End Sub
5.Click on code view of the form and then write the following code.
OUTPUT:
6 . VB application to illustrate the working of a calculator by
using a control array of command buttons.
End Select
opcode = " "
End Sub
OUTPUT:
7. VB application to sort the elements in the given list using Bubble sort.
Option Explicit
Dim x(10) As Integer, n As Integer, i As Integer, j As
Integer, t As Integer
OUTPUT:
10. Visual Basic Application to generate Electricity Bill.
OUTPUT:
11. Visual Basic application, which develops a student mark list.
Conditions:
i.read any 5 subject marks.
ii.for qualifying minimum marks are 40%.
iii .for pass average is 50%
iv .for first class percentage is>=60
v .for second class percentage is between 40 and 59.
Vi .for third class percentage is 40
Vii .minimum percentage is<50 then result is fail.
1. Start VB and create a new standardEXE project.
2. Place the controls as shown below.
3. Click on codeeditor of the form and write the code.
Dim total As Integer, avg As Double
Dim s1, s2, s3, s4, s5 As Integer
Private Sub Command1_Click()
s1 = Val(Text1.Text)
s2 = Val(Text2.Text)
s3 = Val(Text3.Text)
s4 = Val(Text4.Text)
s5 = Val(Text5.Text)
If s1 >= 40 And s2 >= 40 And s3 >= 40 And s4 >= 40 And s5 >= 40
Then
total = s1 + s2 + s3 + s4 + s5
avg = total / 5
If avg = 50 Then
Text6.Text = "pass"
ElseIf avg >= 60 Then
Text6.Text = "first class"
ElseIf avg > 40 And avg < 50 Then
Text6.Text = "second class AND FAIL"
ElseIf avg >= 50 And avg <= 59 Then
Text6.Text = "secondclass and pass"
ElseIf avg = 40 Then
Text6.Text = " qualified ,third class AND FAIL"
End If
Else
Text6.Text = "fail"
End If
End Sub
OUTPUT:
12. VB program to generate the traffic signal.
Shpred.BackColor = vbRed
Shpyellow.BackColor = vbWhite
Shpgreen.BackColor = vbWhite
Lblmessage.Caption = "stop"
Tmrlights.Interval = 18000
Case 2
Shpred.BackColor = vbWhite
Shpyellow.BackColor = vbWhite
Shpgreen.BackColor = vbGreen
Lblmessage.Caption = "go"
Tmrlights.Interval = 12000
Case 3
Shpred.BackColor = vbWhite
Shpyellow.BackColor = vbYellow
Shpgreen.BackColor = vbWhite
Lblmessage.Caption = "wait"
Tmrlights.Interval = 6000
End Select
End Sub
7. Save the form and project.
8. run the form by pressing F5 key.
OUTPUT:
13. VB program to create menus.
4.In the general tab specify the text and tooltip text for date and time
5.place the timer on the MDI form and set interval property of timer
to 100
6.click on codeview of the MDI form and write the following code.
Private Sub mnunew_Click()
Dim newform As New Form1
Form = Form + 1
newform.Caption = "childform" + Str(Forms)
newform.Show
End Sub
7.In that select ADD button then Create New DataSource dialog box
Appears
8.Now select Microsoft ODBC for Oracle and then select finish
9. Now Microsoft ODBC for Oracle Setup dialog box appears in that
select datasurce name as emp10,Description as project and
Username as scott and press ok
11.Now save the project and run the form by pressing F5 key