Question: 1.) Assume that a variable is created within some block of code. If that variable is created without any modification from its default structure, what
1.) Assume that a variable is created within some block of code. If that variable is created without any modification from its default structure, what is its scope?
| A.) | The function or subroutine that immediately contains the block | |
| B.) | The entire computer | |
| C.) | The class (in this case, form) that it belongs to | |
| D.) | That block only |
2.) Assume that you have been asked to write a function or a subroutine that needs to modify one of its inputs directly and the program needs that to be valid even after the program has exited the subroutine or the function. How do you accomplish that?
| A.) | This cannot be done because a subroutine is not allowed to modify anything about the program. | |
| B.) | Denote whichever parameter needs to be modified with ByVal | |
| C.) | Do nothing. This is the default behavior of these practices. | |
| D.) | Denote whichever parameter needs to be modified with ByRef |
3.) How can a Select Case Block be otherwise created without using Select or Case?
| A.) | Using excessive numbers of logical statements to store everything in a single If | |
| B.) | A sequence of Ifs | |
| C.) | A sequence of Else Ifs |
4.) Consider the following type of statement:
If...
Then...
If...
Then...
End...
End
What is this type of statement called in programming terms?
| A.) | This is bad programming and should never be done. | |
| B.) | Nested If | |
| C.) | Daisy Chaining | |
| D.) | Select Case Block |
5.) Consider a program with a statement like this:
If ...
Then ...
Else If ...
Then ...
End
Which best encapsulates the behavior of the program?
| A.) | The program evaluates the IF condition. If it is TRUE, then the THEN happens. Then the ELSE IF is evaluated. If it is TRUE, then the next THEN happens and the program ends without going beyond END. | |
| B.) | The program evaluates the IF condition. If it is TRUE, then the THEN happens. If it is FALSE, the ELSE IF is evaluated. If it is TRUE, then the next THEN happens. Regardless of these outcomes, the program continues after END. | |
| C.) | The program evaluates the IF condition. If it is TRUE, then the THEN happens. If it is FALSE, the ELSE IF is evaluated. If it is TRUE, then the next THEN happens and the program ends without going beyond END. | |
| D.) | The program evaluates the IF condition. If it is TRUE, then the THEN happens. Then the ELSE IF is evaluated. If it is TRUE, then the next THEN happens. Regardless of these outcomes, the program continues after END. |
6.) Consider the following statement:
If ...
Then ...
Else ...
End
Which of these best describes the behavior of the code?
| A.) | The program evaluates the IF condition. If it is TRUE, then the THEN happens. If it is FALSE, the ELSE condition is evaluated. If the ELSE condition is false, the program continues after END (unless a close action occurs in the triggered components) | |
| B.) | The program evaluates the IF condition. If it is TRUE, then the THEN happens. If it is FALSE, the ELSE happens. Regardless of these outcomes, the program continues after END (unless a close action occurs in the triggered components) |
7.) Consider a statement like this:
If ....
Then ....
End
Which of these best describes the behavior of the code.
| A.) | The expression attached to IF is evaluated. If it is TRUE, then the THEN statement happens. If it is FALSE, then the lines after END occur. | |
| B.) | The expression attached to IF is evaluated. If it is TRUE, then the THEN statement happens. Regardless of the outcome of that, the code continues as normal. |
8.) What would be the output of the following command:
"Matt is a batter, but is also the mad hatter".IndexOf("tt")
| A.) | 40 | ||||||||||||||||||||||||||||||||||||||||||||||
| B.) | [3, 13, 41] | ||||||||||||||||||||||||||||||||||||||||||||||
| C.) | 2 | ||||||||||||||||||||||||||||||||||||||||||||||
|
| D.) 3
9.) How do we distinguish a function from a subroutine?
10.) Inside of both functions and subroutines, there are arguments. Which of the following is not necessary to declare when Option Strict and Option Explicit are enforced?
11.) What is the most logical consequence of modular design?
12.) Which of these is not an advantage of structured programming?
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
