visual basic 2
visual basic 2
(b) Explain the main difference between object-oriented and procedural programming languages (2
Marks)
1. User Interface (UI): The visual components (forms, buttons, labels) seen by users.
(d) Explain the difference between the Dim and Global variable declaration (3 Marks)
Dim: Declares variables with local scope (visible within the procedure or module).
Example: Dim x As Integer = 10
(e) Giving examples, explain the difference between methods and properties (4 Marks)
(g) Define a VB statement and explain two types of conditional statements (3 Marks)
Conditional Statements:
6. End Select
(h) Describe the difference between design-time and run-time in Visual Basic. (4 Marks)
Design-Time: When you design the application interface and write code.
Run-Time: When the application executes and users interact with it.
(i) Describe any SIX elements displayed in the IDE by default. (6 Marks)
(a) Reasons for implementing VB over procedural languages like Pascal (4 Marks)
1. Design the UI: Add controls like buttons, labels, and text boxes.
txtBox2.Text = txtBox1.Text
TextBox1.Clear()
1. Simple If:
3. If...Else:
5. Nested If:
6. If x > 10 Then
8. End If
9. If...ElseIf:
10. If x = 1 Then
11. MsgBox("One")
13. MsgBox("Two")
14. End If
Label1.Text = "Pass"
End If
3. String: Text.
For i = 1 To 10
MsgBox("Hello")
Next
MsgBox("Hello")
Next