Home
MCQS
VB.Net MCQ Quiz Hub
VB.Net Mcq Question Set 8
Choose a topic to test your knowledge and improve your VB.Net skills
1. _________ in flowchart is used to represent a for clause.
Circle
Rectangle
Parallelogram
Hexagon
2. How many times will the MessageBox.Show method in the following code be processed? For intNum As Integer = 5 To 1 Step -1 MessageBox.Show(“Hi”) Next intNum
6
5
4
70
3. What value is stored in the intNum variable when the loop ends? For intNum As Integer = 5 To 1 Step -1 MessageBox.Show(“Hi”) Next intNum
0
1
2
3
4. The ______ ensures that the computer processes any previous lines of code that affect the interface’s appearance.
Refresh Method
Sleep method
Count method
Accumulator method
5. To delay program execution, you can use the ______
Refresh Method
Sleep method
Count method
Accumulator method
6. A millisecond is ________ of a second.
1/1000
1/100
1/10
1/10000
7. Which of the following statements pauses program execution for 1 second?
System.Threading.Thread.Pause(1000)
System.Threading.Thread.Pause(1)
System.Threading.Thread.Sleep(1000)
System.Threading.Thread.Sleep(100)
8. What will the following code display in the lblSum control? Dim intSum As Integer Dim intY As Integer Do While intY < 3 For intX As Integer = 1 To 4 intSum = intSum + intX Next intX intY = intY + 1 Loop lblSum.Text = Convert.ToString(intSum)
5
8
15
30
9. A _______displays a list of choices.
List box
Display box
Choice box
Check box
10. The number of choices the user can select is controlled by the list box’s _______
SelectionModeProperty
Select Property
Check Property
IsSelect Property
11. The items in a list box belong to a collection called the ______
Collection
Items Collection
Items Add
Add
12. You specify each item to display in a list box using the Items collection’s________
Add method
Subtract method
Divide method
Multiply method
13. Every variable has both a value and ______
Unique address
Value
Name
Relative address
14. Passing a copy of the variable is referred to as _________
Pass by value
Pass by address
Pass by reference
Pass by pointer
15. Passing a variable’s address is referred to as __________
Pass by value
Pass by address
Pass by reference
Pass by pointer
16. To pass a variable by value, you include the keyword ________________ before the name of its corresponding parameter.
ByVal
Val
PassVal
Pass
17. The _____statement does not indicate whether a variable is passed by value or by reference.
Call
Parameter
Function
Declaration
18. The position of an item in a list box depends on the value stored in the list box’s _______
Ascending property
Descending Property
Sorted property
Unsorted property
19. The items in a list box are sorted based on the ___________ characters in each item.
Leftmost
Rightmost
Previous
Next
20. The ___________ keyword tells the computer to pass the variable’s address rather than its contents.
ByRef
ByVal
ByAdd
ByPoint
21. The items listed in the Call statement are referred to as _________
Arguments
Parameters
Passers
Callers
22. Which of the following is false?
A function can return one or more values to the statement that invoked it
A procedure can accept one or more items of data passed to it
The parameter List in a procedure header is optional
At times, a memory location inside the computer’s internal memory may have more than one name
23. ________ returns a value after performing its specific task.
Function Procedure
Sub procedure
Sub block
Structure
24. The functions header and footer contains the _____ keyword.
Function
Struct
Sub
Class
25. A function’s header includes the ___________ data type.
As
To
From
By.nametags
26. A function can receive information either by value or by _________
Reference
Address
Pointer
Value
27. Between the function’s _____________ and ___________________ you enter the instructions to process when the function is invoked.
Header and footer
Parameters and arguments
Call and return
Return type and function name
28. ______ statement is the last statement in the function.
Footer
Header
Return
Call
29. Each memory location listed in the parameterList in the procedure header is referred to as _______
an address
a constraint
a parameter
a value
30. To determine whether a variable is being passed to a procedure by value or by reference, you will need to examine ______
the Call statement
the procedure header
the statements entered in the procedure
the procedure footer
31. Which of the following is false?
The sequence of the arguments listed in the Call statement should agree with the sequence of the parameters listed in the receiving procedure’s header.
The data type of each argument in the Call statement should match the data type of its corresponding parameter in the procedure header.
The name of each argument in the Call statement should be identical to the name of its corresponding parameter in the procedure header.
The name of each argument in the Call statement should be identical to the name of its corresponding parameter in the procedure header.
32. Which of the following instructs a function to return the contents of the decStateTax variable?
Return decStateTax
Return ByVal decStateTax
Send decStateTax
SendBack decStateTax
33. Which property is used to specify a combo box’s style?
ComboBoxStyle
DropDownStyle
DropStyle
Style property
34. The items in a combo box belong to which collection?
Items
List
ListBox
Values
35. Which of the following selects the Cat item, which appears third in the cboAnimal control?
cboAnimal.Selected = 2
cboAnimal.Selected = “Cat”
cboAnimal.Text = “Cat”
cboAnimal.SelectedIndex=”Cat”
36. The item that appears in the text portion of a combo box is stored in which property?
SelectedText
SelectedValue
Text
TextItem
37. The _______________ event occurs when the user either types a value in the text portion of a combo box or selects a different item in the list portion.
ChangedItem
ChangedValue
SelectedItemChanged
TextChanged
38. A form’s _______ event is triggered when you click the Close button on its title bar.
Close
CloseForm
FormClose
FormClosing
39. A form’s ____________ event is triggered when the computer processes the Me.Close() statement.
Close
Closing
FormClose
FormClosing
40. Which of the following statements prevents a form from being closed?
e.Cancel = False
e.Cancel = True
e.Close = False
sender.Close = False
41. Which of the following rounds the contents of the intNum variable to three decimal places?
Math.Round(3, intNum)
Math.Round(intNum, 3)
Round.Math(intNum, 3)
Round.Math(3, intNum)
42. A ______ allows you to select from a list of choices.
Combo Box
Combo List
Check Box
Radio Button
43. The number of characters contained in a String is stored as Integer in String’s ______
Substring property
Length property
Reverse property
Index property
44. _______ method is used to remove space from beginning and end of a string.
Trim
Remove
Truncate
DeleteSpace
45. _________ method is used to remove specified number of characters located anywhere in the String.
Trim
Remove
Truncate
DeleteSpace
46. What will contain in txtFirst after the following Visual Basic code is executed? strName = "Penny Swanson" txtFirst.Text = strName.Remove(5)
Penny
Swanson
Penny S
y Swanson
47. What will be the value of num after the following Visual Basic code is executed? strName=”Veronica Yardley” num=strName.Length
15
16
14
17
48. ________ method allows you to insert anywhere in the string.
Remove
Insert
Import
delete
49. What will be in strName after the following code is executed? strName=”Joanne Hashen” strName=strName.Insert(7,”C.”);
Joanne C. Hashen
JoanneC.hashen
Joanne
C.Hashen
50. __________ and ________ methods are used to align characters in a String.
PadLeft, PadRight
Left, Right
LeftAlign, RightAlign
AlignLeft, AlignRight
Submit