ITEC81 Flashcards

1
Q

What do control statements in VB.NET primarily manage?

A) Memory allocation
C) User interface design
B) Code execution based on conditions
D) Database connections

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is NOT a type of control statement in VB.NET?

A) If-Then Statement
C) For Each Statement
B) Select Case Statement
D) While-For Statement

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In an If-Then statement, what happens if the condition evaluates to false?

A) The code inside the If block is executed.
C) An error occurs.
B) The code after the End If is executed.
D) The program terminates.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the Select Case statement allow you to do?

A) Iterate through a loop
C) Declare variables
B) Test a variable against multiple values
D) Handle exceptions

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which statement is used to ensure a code block executes at least once?

A) Do Until B) While
C) Do While D) For Next

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of Integer.TryParse in VB.NET?

A) Convert strings to dates
C) Convert integers to strings
B) Convert strings to integers safely
D) Check if a string is empty

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What type of loop is executed a specific number of times?

A) While loop
B) For…Next loop
C) Do…Loop
D) Nested loop

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In the For Each…Next loop, what does the “item” variable represent?

A) The index of the collection
C) The current element being processed
B) The collection itself
D) The number of items in the collection

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which of the following loops continues until a specified condition is true?

A) Do While loop
B) Do Until loop
C) For…Next loop
D) While loop

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the End With statement do?
A) Ends a loop
C) Terminates the program
B) Closes a block of code associated with a With statement
D) Executes the previous block

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the key benefit of using With…End With?

A) Increases execution speed
C) Reduces redundancy in code
B) Reduces code readability
D) Prevents logical errors

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Nested loops are primarily used for:

A) Error handling
C) Complex iterations over data sets
B) Iterating over collections
D) Database transactions

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the Step keyword do in a For…Next loop?

A) Determines the starting point of the loop
C) Specifies the increment or decrement value
B) Sets the data type of the counter D) Marks the end of the loop

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In a While…End While loop, what happens if the condition is false?

A) The loop continues
C) An error occurs
B) The loop terminates
D) The code inside the loop executes

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The Do Until loop:

A) Runs at least once before checking the condition
C) Runs infinitely
B) Stops when the condition is true D) Is not a valid loop type in VB.NET

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The expression in a Select Case statement must evaluate to which data type?

A) Only Integer
B) Any elementary data type
C) String only
D) Boolean only

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the Application.DoEvents() method do?

A) Pauses the application
C) Terminates the application
B) Keeps the UI responsive
D) Starts a new event

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

If a condition in an If-Then-ElseIf statement is met, what happens?

A) All conditions are checked
C) The program terminates
B) Only the block for that condition executes
D) The Else block executes

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What type of loop is best for processing items in a collection?

A) For…Next loop
B) Do While loop
C) For Each…Next loop
D) While loop

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The Exit Do statement is used in which type of loop?

A) For…Next
B) Do…Loop
C) While…End While
D) For Each…Next

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which statement allows execution based on multiple conditions?

A) If-Then B) Select Case
C) For…Next D) While…End While

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

A For…Next loop is ideal for:

A) Uncertain iteration counts
C) Infinite loops
B) Known iteration counts
D) Exception handling

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

In the For…Next loop, which of these is optional?

A) Start
B) End
C) Step
D) Next

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

The Do While loop ensures that:
A) The code runs at least once
C) The loop cannot exit
B) The condition is always checked
D) No code runs if false

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

If an Else block exists, it executes when:

A) All conditions are true
C) The program terminates
B) The initial condition is false
D) None of the statements run

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

The For Each…Next loop simplifies:

A) Index management
C) Error handling
B) Memory allocation
D) File operations

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

The Do While loop guarantees:

A) At least one iteration
C) Execution only if true
B) Infinite execution
D) No execution if false

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

The If-Then-Else statement can execute two blocks of code based on a condition.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Control statements in VB.NET can only handle Boolean conditions.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

The Select Case statement can only evaluate strings.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

A While loop guarantees that the code inside will run at least once.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

The For Each…Next loop requires manual index management.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Nested loops can be used to process multi-dimensional arrays.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

The Do While loop executes as long as the condition is true.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

You can only use integer types as counters in loops.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

The With statement allows repeated reference to the same object.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

The Step keyword in a For…Next loop is mandatory.

A

F

38
Q

If no conditions in an If-Then-ElseIf statement are met, the Else block will execute

A

T

39
Q

The Do Until loop runs indefinitely until the condition is true.

A

F

40
Q

Application.DoEvents() is used to pause execution.

A

F

41
Q

The End With statement is used to close a With block.

A

T

42
Q

Control statements do not affect the flow of program execution.

A

F

43
Q

The While loop guarantees at least one execution of the code block.

A

F

44
Q

Application.DoEvents() halts the UI thread

A

F

45
Q

The Exit statement is used to leave a loop prematurely.

A

T

46
Q

The Step keyword specifies how much to increment the loop counter.

A

T

47
Q

In VB.NET, a procedure:

A) Is a function that always returns a value
B)
C) Executes a specific task
D) Is only for handling errors

A

C

48
Q

A procedure that returns a value is called:
A) Sub B) Function
C) Method D) Routine

A

B

49
Q

Function procedures are designed to:

A) Execute and return a result
C) Handle errors
B) Perform actions without a return D) Only display output

A

A

50
Q

Procedures enhance code:
A) Complexity C) Organization
B) Complication D) Length

A

C

51
Q

A Sub procedure:

A) Returns a value to the caller
B) Can accept parameters
C) Performs tasks without returning any value
D) Can be called only once

A

C

52
Q

The keyword that marks the end of a function is:

A) End Function C) Return
B) End Sub D) Finish

A

A

53
Q

Optional parameters in a function allow:

A) No parameters to be defined
B) Only ByRef specifications
C) Default values when arguments are not provided
D) Mandatory parameters only

A

C

54
Q

The purpose of function overloading is to:

A) Define multiple functions with the same name and different
signatures
B) Limit the number of function calls
C) Increase redundancy
D) Ensure all functions return a value

A

A

55
Q

Parameters in a procedure are used to:

A) Define output variables
B) Allow input to the procedure
C) Specify error types
D) Limit the number of times a procedure can be called

A

B

56
Q

A function can:

A) Return a value to the caller
C) Modify global variables
B) Only display messages
D) Be called without being defined

A

A

57
Q

Encapsulation in procedures helps:

A) Reduce redundancy
C) Create errors
B) Increase complexity
D) Limit code reuse

A

A

58
Q

ByRef parameters allow:

A) Copies of the original data
B) Direct modifications to the original variable
C) Only temporary data storage
D) No parameters at all

A

B

59
Q

The body of a procedure must include:

A) Only comments
C) Only return statements
B) Executable code that performs tasks
D) External references

A

B

60
Q

An example of a function name might be:

A) ProcessData C) CalculateTotal
B) ExecuteTask D) CompleteJob

A

C

61
Q

Subs do not return values, which:

A) Increases their versatility
B) Limits their functionality
C) Makes them more useful than functions
D) Requires more parameters

A

B

62
Q

One benefit of procedures is:

A) They complicate collaboration
B) They allow simultaneous development of independent tasks
C) They require single-person programming
D) They decrease modularity

A

B

63
Q

The execution of a procedure:

A) Depends on global variables only
B) Is triggered when the procedure is called
C) Occurs automatically without calls
D) Is limited to one-time execution

A

B

64
Q

The ParamArray feature allows:

A) A fixed number of arguments
C) A variable number of arguments
B) Only single arguments
D) No parameters at all

A

C

65
Q

The Return statement in a function:

A) Declares the function
B) Marks the end of the function
C) Specifies the value to return to the caller
D) Indicates a syntax error

A

C

66
Q

The body of a function can include:

A) Only return statements
B) Executable statements processing data
C) Only parameter definitions
D) Summary comments only

A

B

67
Q

Optional parameters can have:

A) No default values
B) Default values if not provided
C) Only ByVal specifications
D) Fixed values that cannot be changed

A

B

68
Q

What does the procedure declaration specify?

A) The procedure’s logic
B) The name, parameters, and return type
C) The type of error handling
D) The execution time

A

B

69
Q

Which statement about procedures is correct?

A) They must return values
B) They can enhance maintainability and clarity
C) They are only used once in a program
D) They cannot have parameters

A

B

70
Q

What defines a procedure in VB.NET?

A) A set of functions
B) A collection of variable declarations
C) A block of code performing a specific task
D) A method for error handling

A

C

71
Q

Modularity in programming is primarily for:

A) Complicating code structure
B) Enhancing code readability and organization
C) Reducing the amount of code
D) Making code execution faster

A

B

72
Q

In parameter passing, ByVal means:

A) It passes a reference to the original variable
B) It allows changes to the original variable
C) It passes a copy of the variable to the procedure
D) It only works with numeric values

A

C

73
Q

The concept of code reusability means:

A) Writing unique code for each operation
B) Encapsulating functionality to avoid redundancy
C) Increasing the overall code size
D) Making code more complex

A

B

74
Q

The difference between ByRef and ByVal is that:

A) ByVal changes the original variable, while ByRef does not
B) ByRef passes a reference, ByVal passes a copy
C) Both behave the same
D) ByVal can only be used in functions

A

B

75
Q

Procedures allow for better collaboration because:

A) They limit the number of developers
B) They allow simultaneous development of independent tasks
C) They complicate team communication
D) They require all code to be written at once

A

B

76
Q

A Sub procedure can return a value.

A

F

77
Q

The Function keyword defines a function in VB.NET.

A

T

78
Q

Procedures can reduce code redundancy.

A

T

79
Q

Optional parameters cannot have default values.

A

F

80
Q

Function procedures are more flexible than Sub procedures.

A

T

81
Q

The End Sub keyword indicates the end of a Sub procedure.

A

T

82
Q

Only functions can accept parameters in VB.NET.

A

F

83
Q

Procedures enhance code readability.

A

T

84
Q

ByRef parameters allow original variable modifications.

A

T

85
Q

All parameters must be specified for a Sub.

A

F

86
Q

Functions in VB.NET cannot be overloaded.

A

F

87
Q

A procedure’s body must have executable code.

A

T

88
Q

Procedures can only exist in modules, not classes.

A

F

89
Q

Reusable code improves efficiency in programming.

A

T

90
Q

A procedure must have at least one parameter.

A

T

91
Q

All parameters must be specified when calling a Sub.

A

F

92
Q

A procedure must have at least one parameter.

A

F