Professional Documents
Culture Documents
Q 1:
1)
2)
Extension of VB project is
a) .vba
b) .vbp
c) .vb
d) .vbf
3)
4)
____________ statement allows the control flow to jump over a labeled code
location somewhere else in a program.
a) Label
b) GoTo
c) Switch
d) If-Else
5)
_____________ loop executes the code if the condition is true and continues to
perform it until the condition becomes false.
a) Do While-Loop
b) Do-Loop While
c) Do-Until Loop
d) For-Next Loop
6)
(10)
7)
If I wanted to multiply the value that the user has typed into txtInput by 5 and
store the value in lblOutput, I would type
a) Me.lblOutput.Text = txtInput.Text * 5
b) txtInput * 5 = lbloutput
c) me.lblOutput.Text = txtInput.Text times 5
d) lblOutput.value = txtInput.value * 5
8)
A programmer creates a form that has two text boxes, txtFoo and txtBar. The
programmer types the following code in: Me. lblAnswer.text = me.txtFoo.Text +
me.txtBar.Text If the user types the number 5 into txtFoo and the number 12
into txtBar, what is put into lblAnswer?
a) 512
b) 60
c) 17
d) 125
9)
VB stands for
a) Visual Building
b) Visual Basic
c) View Building
d) View Basic
10)
When creating a message box, to have it display Abort, Retry and Ignore
buttons, you would type:
a) msgbox(message,Abort,Retry,Ignore)
b) msgbox(message)
c) msgbox(message, AbortRetryIgnore)
d) msgbox(MsgBoxStyle.AbortRetryIgnore)
Q 2:
Q 3:
Write a VBA code to enter a password from the user. If the user enters a (5)
password other than SCET, loop continues to prompt for the correct password.
Q 4:
Q 5:
(5)
(3)
(2)
Write a Program in VB to accept two numbers in the Textbox and add them (5)
without using Val and with using Val.