Values stored in constants _______ during the execution of an application.
Trang 12. Constant names may or may not be a valid symbolic name [0.5]
Trang 210 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]
11 In a While Loop the statements are repeated as long as the condition
12 In a Do Loop statement using Until keyword looping continues until
Trang 3a) True c) False
13 When an array declared is of type Object, it can have data of any data
14 No two arrays declared are of the same data type unless they have the
15 There is/are possible source/sources for constants [0.5]
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
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
Trang 4b) 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
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
Trang 522 Conditional statements allow conditional execution of statements
based on expressions evaluated at run time
[1.0]
23 In an If Then Else statement, the comparision can be any
expression that evaluates to:
[1.0]
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
Trang 6b) 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
29 To exit from a While loop when the loop is endless we use the
31 To exit from a For Each Next loop before it has traversed the
Trang 7a) Exit d) End For Each
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
Trang 8Dim 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
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
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,
Trang 9you 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
41 A class can gain the properties and behaviour of an existing class and
this is done by a process known as
Trang 10a) 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]
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]
Trang 11a) 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
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]
Trang 12compilation error as multiple expressions or ranges in the caluse shown in line 4 cannot be used.
50 Identify the correct statements with respect to For Each Next loop [2.0]
a) The 'For Each Next' loop is
entered if there is at least
one element in a group.
c) Only one 'Exit For' can be
used in this loop
b) Any number of 'Exit For'
statements may be placed
anywhere in the loop as an
alternative way to exit.
d) Each loop must have a unique element variable.
51 Dim Counter As Integer = 2
Trang 1353 When you want to use the value returned by a function, you can use a
function procedure on the side of an expression
56 When a variable is passed by value, the ByVal keyword is used
57 The called program can access the original data when a
pointer of the data is copied while passing the argument as reference [0.5]
Trang 1459 The Dispose method is implemented by default for any component that
inherits from System.ComponentModel.Component and it is used to make the program free all system resources it may have allocated
[0.5]
60 While handling an event in the client program, the object declared
using the WithEvents keyword has to be declared: [0.5]
a) inside the procedure or
function at the module level
b) outside the procedure or function at the module level.
c) Protected
62 What happens after the Sub procedure returns to the calling program? [1.0]
a) Execution stops c) Execution continues with
the statement following the statement that called it.
b) Execution continues with the
previous statement, from the
statement that called it,
verifying if the action was
performed
d) None of the above
63 Which of the following statement is true, when an argument passed is
by value using the ByVal keyword
[1.0]
a) it is possible to modify the
members of the objects to
which it points, if the
d) it is possible to modify the variables itself, if the argument passed is a
Trang 15argument is a reference
type.
variable argument.
b) it is possible to replace the
value of the object
e) it is possible to modify the
members of the objects to which it points, if the argument passed is a variable argument
c) it is the default value in case
64 Which of the following is true, when an argument passed is by
a) it is possible to modify the
members of the objects to
which it points, if the argument
is a reference type
c) it is the default value in case
of Visual Basic
b) it is possible to modify the
variable itself if a variable
argument is passed.
d) it is possible to modify the
variables itself, if the argument passed is a reference type
65 Executing different methods at runtime using a common method name
66 When two "System.Console.WriteLine" statements are used, they will
a) the same line by appending
the first set of data with the
next set
c) the same line by overwriting
the first set of data with the next set
b) different lines as the
Trang 16statement also indicates a
carriage return
67 When two "System.Console.Write" statements are used they will
display the selected data on
[1.0]
a) the same line by appending
the first set of data with the
next set.
c) the same line by overwriting
the first set of data with the next set
b) different lines, as the
statement also indicates a
carriage return
68 Sub trial (ByVal dt1 As String)
'Code that makes changes to dt1
End Sub
Can the above variable be forced by the calling code to pass by reference?
[1.0]
a) The above variable can be
forced by the calling code to
pass by reference
b) The above variable cannot
be forced by the calling code to pass by reference.
69 Sub trial (ByRef dt1As String)
'Code that makes changes to dt1
End Sub
Can the above variable be forced by the calling code to pass by value?
[1.0]
a) The above variable can be
forced by the calling code to
pass by value
b) The above variable cannot
be forced by the calling code
c) The constructor method is
always called by the same name as the class
b) It allows you to set the final d) The constructor method is
Trang 17state of an object always called New
regardless of the name of the type
71 It is a must for the parameter list and the return type of the function to
match the parameter list and return type of the function that is declared
c) another procedure f) All of the above
73 Identify the correct statements with respect to procedures [1.5]
a) A procedure cannot have any
Exit Sub statements in it
d) A procedure cannot have
more than three Exit Sub statements in it
b) A procedure cannot have more
than one Exit Sub statement in
it
e) A procedure can have any number of Exit Sub statements anywhere in it.
c) A procedure cannot have more
than two Exit Sub statements
in it
74 Identify the correct statements with respect to procedures [1.5]
a) A procedure cannot have any
Return statements in it
c) A procedure cannot have
more than three Return statements in it
Trang 18b) A procedure cannot have more
than one Return statement in
b) always returns a value to the
calling procedure e) can be called using a Call statement.
c) cannot return a value to the
calling procedure
f)
76 Identify the correct statements with respect to Functions [1.5]
a) Function procedures are
Private by default
d) It is possible to return a value from a function including it in a Return statement.
b) Any number of Exit Function
statements can appear
anywhere in the procedure.
e) The function sets the default value to argtype if you use Exit Function without assigning a value
to the name of the function.
c) Only a single Exit Function
statement can appear
anywhere in the procedure
a) Passing a ByRef argument c) Passing a ByRef argument
Trang 19proves advantageous as the
procedure can return a value
to the calling code using the
same argument.
proves advantageous as it protects a variable from being changed by the called procedure
b) Passing a ByVal argument
proves advantageous as the
procedure can return a value
to the calling code using the
Trang 20a) 12,48 d) 1212
c) 12,12
80 1 Private WithEvents Obj1 as Class1
2 Private WithEvents Obj2 as Class1
3 Private Sub OnMyEvent (ByVal t1 as integer)
4 Handles Obj1.MyEvent, Obj2.MyEvent
a) While executing a Try block it
is a must to provide both the
Catch and Finally block
c) It is possible to have more than one Catch Blocks in a single Try Block.
b) While executing a Try block
it is a must to provide either
the Catch or Finally block.
d) Exit Try is used to jump out of the structure whenever required.
a) Sub [ (argumentlist) ] subname
'Statements of the Sub
procedure go here
End Sub
c) Sub subname[ (argumentlist)
] 'Statements of the Sub procedure go here
End
Trang 21b) Sub [(argumentlist)] subname
'Statements of the Sub
procedure go here
End
d) Sub subname[ (argumentlist) ] 'Statements of the Sub procedure go here.
End Sub
83 Identify the correct rules applicable to overloading [2.0]
a) You must differentiate any
two versions of a procedure
by their argument lists.
d) You can overload a Function procedure with a Sub procedure, and vice versa, provided they have different argument lists.
b) You can use everything other
than the argument list to
differentiate versions For
example, you cannot have two
overloads that differ only in
their return types
e) You cannot overload a
method or a property on a class you are defining
c) Versions that are properly
differentiated by their
argument lists can have same
return types or same argument
modifiers
f) You cannot define a method and a property with the same name in the same class In other words, you cannot overload a method with a property, or vice versa.
84 1 Public Sub example1(ByVal x As Integer, ByVal y As Integer, ByVal
z As Integer)
2 Try
3 x /= (y * z)
4 Catch ex As Exception When y = 0
5 textbox1.text = "Its an error"