Tải bản đầy đủ (.doc) (29 trang)

Question Bank VB .net

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (241.87 KB, 29 trang )

Question Bank
VB .net
1. Values stored in constants _______ during the execution of an
application.
[0.5]
a) may change b) remain unchanged
2. Constant names may or may not be a valid symbolic name. [0.5]
a) True b) False
3. Char datatype contains Unicode values. [0.5]
a) True b) False
4. Char datatype consumes _____ of space. [0.5]
a) 2 bits c) 2 bytes
b) 4 bits d) 4 bytes
5. Decimal data type in VB.net is ______ bits. [0.5]
a) 8 d) 64
b) 16 e) 128
c) 32
6. In VB .net, an integer is of _____bits [0.5]
a) 8 d) 64
b) 16 e) 128
c) 32
7. ______data type in VB .net can hold any type of data [0.5]
a) Numeric d) Variant
b) String e) Object
c) Char
8. In VB .net, a long is _________bits [0.5]
a) 8 d) 64
b) 16 e) 128
c) 32
9. Constants may be part of the object model for controls or user-defined
constants.


a) True b) False
10. If you have no code to run when the condition is False in an
If...Then...Else statement then you omit the Else statement.
[0.5]
a) True b) False
11. In a While Loop the statements are repeated as long as the condition
is:
[0.5]
a) True b) False
12. In a Do...Loop statement using Until keyword looping continues until
the condition returns:
[0.5]
a) True c) False
13. When an array declared is of type Object, it can have data of any data
type.
[0.5]
a) True b) False
14. No two arrays declared are of the same data type unless they have the
same rank and element data type.
[0.5]
a) True b) False
15. There is/are ________ possible source/sources for constants. [0.5]
a) One c) Three
b) Two d) Four
16. A drop-down list is provided by VB .net [1.0]
a) at the top of the code
window with all the objects
and events.
c) at the top of the code window
with only the events.

b) at the bottom of the code
window with all the objects and
events.
d) at the top of the code window
with only the objects.
17. Dim s as Integer
Dim t As Integer="10"
s = t +10
What will the above code do?
[0.5]
a) declare 't' as an integer but will
not assign it with any value. 's'
will be assigned the final value
as 10.
c) declare 't' as an integer and
will assign it the string 10. 's'
will be assigned the final
value as 10 + 10.
b) declare 't' as an integer and
will assign it the value 10.
's' will be assigned the final
value as 20.
d) result in an error, as 't' has
not been assigned to an
integer but a string.
18. In a decimal data type ______ bits are used for storing the integer part
of the decimal number and _____ bits are used for storing the decimal
part.
[0.5]
a) 32,16 c) 96,32

b) 32,64 d) 128,64
19. The Char datatype contains values ranging from _________. [1.0]
a) 1 - 63335 c) 1 – 65533
b) 0 - 63335 d) 0 – 65535
20. The char datatype is intended for [1.0]
a) use in manipulating single
character values.
c) creating arrays of
character values.
b) use in manipulating multiple
character values.
d) None of the above
21. Any attempt to change the value of the String: [1.0]
a) results in the updating of the
original string.
c) results in a new String
being created to store the
changed value, while
the original string is
destroyed.
b) results in a new String being
created to store the changed
value, while the original string
is placed separately
d) None of the above
22. Conditional statements allow conditional execution of statements
based on expressions evaluated at run time.
[1.0]
a) True b) False
23. In an If...Then...Else statement, the comparision can be any

expression that evaluates to:
[1.0]
a) Only true c) Either True or False
b) Only false
24. Identify the correct statements with respect to if… then...else [1.0]
a) Each expression must be
implicitly convertible to
Boolean.
c) Each expression must be
explicitly convertible to
Boolean.
b) Once a block finishes
executing, execution passes
to the end of the
If...Then...Else statement.
d) Once a block finishes
executing, execution passes
to the start of the
If...Then...Else statement.
25. To execute more than one line of code when a condition is True, you
use which all of the following multi-line syntax
[1.0]
a) If...Then and End If d) If...Then
b) If...Then...Else and End If e) While...Do
c) Select...CASE
26. When comparision of the same expression to different values is done,
we use the:
[1.0]
a) If...Then statement c) Select...CASE statements
b) If...Then...Else statements d) While statement

27. The size of an array which is created __________ [1.0]
a) Cannot be changed after it is
created
c) can be changed after it has
been created using the
Create statement.
b) Can be changed after it has
been created using the
Redim statement
28. When OptionStrict statement is on, a variable of one type can be
automatically converted to another type.
[1.0]
a) True b) False
29. To exit from a While loop when the loop is endless we use the
________ statement.
[1.0]
a) Exit d) Exit While
b) Break e) End While
c) Quit
30. To exit from a Do loop we use the _______ statement [1.0]
a) Exit d) End Do
b) Break e) Exit Do
c) Quit
31. To exit from a For Each...Next loop before it has traversed the
collection we use the ________ statement.
[1.0]
a) Exit d) End For Each
b) Break d) End For
c) Exit For
32. Consider three variables s1, s2, and s3. These variables are declared

as:
" Dim s1, s2, s3 As Integer "
The above declaration indicates:
[1.0]
a) s1, s2, as Objects and s3 as
an Integer.
c) s1, s2, s3 as Integers.
b) s1 as Integer and s2, s3 as
Object data types.
d) the above statement will
result in an error.
33. Identify the correct statements with respect to VB .net. [1.5]
a) It supports late-binding d) All arrays are zero-based.
b) It is case-sensitive e) It supports operator
overloading.
c) It can flag syntactical errors
immediately
34. Dim Trial As Integer = 0
Dim no1 As Integer = 90
While no1> 20
no1 = no1 - 3
Trial = Trial + 1
End While
Identify the number of times the while loop is executed.
[1.5]
a) 24 c) 70
b) 38 d) The loop will not execute
35. Dim Counter As Integer = 0 [1.5]
Dim number As Integer = 20
Do

number = number - 1
Counter = Counter + 1
TextBox1.Text = TextBox1.Text & number
TextBox2.Text = TextBox2.Text & Counter
Loop While number > 20
Identify the number of times the loop is executed.
a) 0 c) 2
b) 1
36. Identify the correct statements with respect to arrays. [1.5]
a) The dimensionality or rank
of the array corresponds to
the number of subscripts
used to indentify individual
elements.
c) You can change the size of
an array after you have
created it.
b) Arrays have a fixed size in
Visual Basic.
d) Every array type is an
individual reference type.
37. The length dimension of an array is limited to the maximum value of
________.
[1.5]
a) (2 ^ 32) d) (2 ^ 32) – 1
b) (2 ^ 64) e) (2 ^ 64) - 1
c) (2 ^ 128) f) (2 ^ 128) - 1
38. Identify the correct statements. [1.5]
a) In a multidimensional array,
you can only change the last

dimension when you use the
ReDim statement.
d) In a multidimensional array,
you can only change the first
dimension when you use
the keyword Preserve.
b) In a multidimensional array, e) In a multidimensional array,
you can only change the
last dimension when you
use the keyword Preserve.
you can only change the first
dimension when you use
the ReDim statement.
c) While using Redim to
preserve the existing values
of an array we use the
keyword Preserve.
39. The ability of a language to create a "black box" code is termed as
_________.
[1.5]
a) Encapsulation c) Polymorphism
b) Abstraction d) Inheritance
40. The ability of a routine to behave differently with different classes is
termed as ________.
[1.5]
a) Encapsulation c) Polymorphism
b) Abstraction d) Inheritance
41. A class can gain the properties and behaviour of an existing class and
this is done by a process known as __________.
[1.5]

a) Encapsulation c) Polymorphism
b) Abstraction d) subclassing
42. _______ strings are compared using binary comparision algorithm. [1.5]
a) OptionExplicit c) OptionCompare
b) OptionStrict
43. The _________ statement requires declaration of all variable [1.5]
a) OptionExplicit c) OptionCompare
b) OptionStrict
44. Identify the correct statements with respect to constants. [1.5]
a) It is a meaningful name that
takes the place of a number or
string that may or may not
change.
d) More than one constant
can be declared on a
single line if you separate
them with commas.
b) It is a meaningful name that
takes the place of a number
or string that does not
change.
e) Constants can be defined
in terms of previously
defined constants.
c) Like a variable it is possible to
assign a new value to a
constant.
45. Assume three variables d1, d2, d3. These variables are declared as
shown in the statement below.
"Dim d1, d2, d3 As Integer = 20". Identify the correct statement.

[2.0]
a) Value of d1, d2 & d3 = 20. c) Value of d1 and d2 =20 and
value of d3=0.
b) Value of d1 and d2 =0, value
of d3 =20.
d) Explicit initialization is not
permitted with multiple
declarators.
46. "Public Const d1 = 20" can be placed in: [Identify the correct options] [2.0]
a) Form Load Event c) Public sub new
b) Public class form event d) None of the above
47. The 'start' button is clicked to debug the code and execute it, if
errors are encountered then these errors are displayed in the
description box. Identify the correct statement.
[2.0]
a) The debugging of the entire
code again takes place after
the programmer again clicks
on the 'start' button.
c) Every time a change is
made after the first time
the 'start' button is clicked.
The code is checked for all
errors and the description
box is updated.
b) Every time a change is made
after the first time the 'start'
button is clicked. The code is
checked for all errors but the
description box is updated only

after the 'start' button is clicked
again.
d) None of the above
48. 1. Dim t1 as integer
2. Select t1
3. [Case t1
4. [statements]]
5. [Case Else
6. [elsestatements] ]
7. End Select
The snippet given above uses the CASE statement. Which of the
following is true with respect to the above snippet [assume the
statements are error free]:
[2.0]
a) the code will execute without
any changes.
c) the above code will
execute as the word Case
is automatically placed in
the beginning of the Select
statement. Hence
statement would be
displayed as "Select Case
t1" at line 2.
b) the above code will not
execute, as a Case statement
should begin with "Select Case
t1" at line 2.
d) None of the above
49. Dim maxnumber As Integer

maxnumber = 40
Select Case maxnumber
[2.0]

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×