R4RIN
Articles
Java 8
MCQS
VB.Net MCQ Quiz Hub
VB.Net Mcq Question Set 5
Choose a topic to test your knowledge and improve your VB.Net skills
1. When you declare a variable in the form’s declaration section, it is called as _______
Class-level variable
Object variable
Procedure-level variable
Auto variable
2. Lifetime of a class-level variable is till _______
A procedure ends
An application ends
A block ends
Within the control section
3. A class-level variable is declared using ______________ keyword.
Private
Public
Dim
static
4. A procedure-level variable is declared using ____________ keyword.
Private
Public
Dim
Static
5. Two procedures can have procedure-level variable whose names are same.
True
False
all of the above
None of the mentioned
6. _____ is a variable that remains in memory, and retains its value even after the procedure declaring it ends.
Procedure-level variable
Class-level variable
Static variable
Dynamic variable
7. Static variable can only be used in the __________ in which it is declared.
Class
Any procedures in the form
Any form
Only the Procedure it is declared in
8. A __________ cannot change its value while the application is running.
Constant variable
Class variable
Named constant
Static constant
9. Named constants are used because ______
Because they take up less space in memory
Because they make documentation and code modification easier
Because they can be easily accessed by procedures
Because they are easily declared
10. What is wrong with the expression “const dblPi As Double = 3.141593”?
Double is written
Name should be DBLPi
“const” starts with a “C”
Value is too large
11. What is wrong with the expression “static dblPi AsDouble ”?
Double is written
Nothing is wrong
“Static” starts with a “S”
Value is not given
12. What happens when a procedure containing the following statements ends? Dim decSales As Decimal=12.2 Static decTotal As Decimal=13.5
Both values lose their values
Dim variable loses its value
Static variable loses its value
Both variables retain their values
13. Using a named constant is advantageous because to change a value in future, change ______
The value in the Const statement
The value of the variable wherever it appears in the program
The value of the variable anywhere in the program
The value of the variable in one of the procedures in the program
14. Unintentional errors in application by declaring variables can be reduced by ____
Giving them Small names
Declaring them with a small sized data type
Giving them minimum scope possible
Making them class variables
15. To declare a class-level named constant you declare it as __________
Public
Dynamic
Private
Static
16. In Visual Basic, if you keep a variable undeclared, it is automatically taken as___________ data type.
Int
Char
String
Object
17. ______ prevents you from using undeclared variable in your code.
Option Explicit On
Option Implicit On
Explicit Off
Implicit Off
18. ______ ensures every variable and named constant is declared with a data type.
Option Infer Off
Option Infer On
Option On
Option off
19. ______ is used to fit the value of the data type to that of the memory location, implicitly.
Implicit type conversion
Explicit type conversion
Convert method
Conversion function
20. When a value is converted from one data type to another and can store numbers with greater precision, the value is said to be ___
Imported
Exported
Promoted
Précised
21. When a value is converted from one data type to another and can store numbers with less precision, the value is said to be ____
Demoted
Promoted
Exported
Converted
22. You can eliminate the problems of implicit type conversion, with the help of ______
Option Strict On
Option Strict Off
Implicit Off
Explicit On
23. Option Strict On disallows conversion of String data type to __________ implicitly.
Double
Object
Character
Array.arrange()
24. Option Strict On disallows conversion of Double data type to __________ implicitly.
Double
Object
Character
String
25. Instead of entering the Option statements in the Code Editor window, you also can enter in the _____
Properties window
Project Designer Window
File Manager
Project Manager
26. The __________ is used to concat to Strings.
Concatenation operator
+ symbol
Concat function
Cat function
27. Specifying the number of decimal places and special characters to display in a number is called as ____
Including
Formatting
Emphasizing
Promoting
28. ____ function is used to format numbers.
toString
toNumber
toFormat
toSpecify
29. The toString method formats the number stored in the numeric value and then returns the result as a _____
Integer
Double
Character
strings
30. ________ in the syntax gives the format you want to use.
formatString
format
numericVariableName
toString
31. ____ displays an input dialog box containing a message, Ok and Cancel button and an input area.
Inputbox function
Inbox function
Dialogbox function
In function
32. ______ is an underscore that is immediately preceded by a space and is located at the end of the physical line of code.
Underscore
Hyphen
Line continuation character
Line termination character
33. The InputBox functions prompt argument should be entered using _____
Book title capitalization
Sentence capitalization
Text capitalization
Post capitalization
34. The value returned by the Inputbox depends on the __________ the user chooses.
Button
Message
Property
Return type
35. The __________ argument contains the message to display inside the dialog box.
defaultResponse
prompt
title
message
36. The __________ constant instructs the computer to advance the insertion point to the next line in control.
ControlChars.NewLine
ControlChars.NextLine
ControlChars.Line
ControlChars.blankLine
37. ______ can be used to advance the insertion point in a file or on the printer.
Advance pointer
Nextpoint pointer
NextLine constant
ControlChars.NewLine constant
38. Which of the following is called the line continuation character?
*
^
–
_
39. ControlChars.NewLine constant is a __________ constant.
Pure
Invariable
Character
Intrinsic
40. What is wrong with the below statement?Msg.Text=”This is an example”&ControlChars.NewLine&“Example”.
Used double quotes, should have used single quotes
No errors
There should be spaces before and after each &
Should have ended with a ;
41. What is the specialty of the Default button?
Always focused by default
Always clears the form it is in
Can be selected by the Enter key even when not focused
Can be selected by the Shift key even when not focused
42. The Cancel Button’s procedure is accessed by __________ key.
Esc
Alt
Ctrl
Shift
43. How many default buttons can a form have?
1
2
3
4
44. How is a default button designated?
Default keyword in the definition of the button
Setting the setfocus property to on
Keeping the button at the bottom of the form
By connecting the AcceptButton property to it
45. What is the correct syntax to designate a default button?
Form.default=button1
Form.defaultButton=button1
Form.AcceptButton=button1
Form.focused=button1
46. In Visual Basic __________ is used for coding single-alternative and dual-alternative selection structures.
If…Then…Else statement
Switch-Case block
Recursion
function overloading
47. The __________ keyword is necessary only in a dual-alternative selection structure.
Alternative
Next
Dual
Else
48. The condition must be a __________ expression.
Integer
Double
Boolean
Short
49. The set of statements contained in each path is referred to as a _____
Condition block
Statement block
Path block
IfElse block
50. What is wrong with the following if-else structure? If intQuantity > 5 Then dblDiscountRate = .1 Else dblDiscountRate = .05 End If
No error
Conditions not in brackets
No ; after statements
Then’ should have been ‘then’
Submit