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?

A.)

A function is labeled as a Function, while a subroutine is labeled as Sub

B.)

A function's header statement ends with something As ____, but a subroutine does not end this way

C.)

A function must include the word return at least once in its block, but a subroutine can never include it

D.)

All of the above

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?

A.)

Its name

B.)

Its data type

C.)

How it is passed to the subroutine or function

D.)

They all must be declared

11.) What is the most logical consequence of modular design?

A.)

Functions or subroutines should have as few lines as possible

B.)

Functions or subroutines should never call other functions or subroutines

C.)

Functions or subroutines should do as few tasks as possible (promoting reusability)

12.) Which of these is not an advantage of structured programming?

A.)

Easy to Write

B.)

Easy to Understand

C.)

Easy to Debug

D.)

Easy to Repurpose

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!