11/14/2024 12:19 PM
CIS 115 Final Exam Study Guide Questions
With Verified Answers
Which one of the following is NOT one of the three basic types of statement structures?
A. repetition
B. sequence
C. input/output
D. decision - answer✔C
What happens to a variable declared locally inside an event procedure or loop block after the
procedure terminates?
A. It is reset to its default value.
B. It loses its value temporarily, but regains that value when the procedure executes again.
C. It ceases to exist after the procedure or loop block ends.
D. It maintains its value even after the block ends. - answer✔C
How many times is the code in the body of a postest loop guaranteed to execute?
A. 0
B. 1
C. 2
D. 3 - answer✔B
How many times is the code in the body of a pretest loop guaranteed to execute?
A. 0
B. 1
C. 2
1|Page
, ©BRIGHTSTARS EXAM SOLUTIONS
11/14/2024 12:19 PM
D. 3 - answer✔A
How many times will the word "Happy" appear in the list box when the following code is
executed?
Dim index As Integer
Do
lstBox.Items.Add("Happy")
index += 1
Loop While index > 3
A. 0
B. 1
C. 2
D. 3
E. This is an Infinite Loop - answer✔B
Which While statement is equivalent to Until num < 100?
A. While num <= 100
B. While num > 100
C. While num >= 100
D. There is no equivalent While statement. - answer✔C
Identify the accumulator in the following loop block code segment.
Dim temp, tot, check As Integer
Do
temp = CInt(InputBox("Enter a number."))
tot += temp
check += 1
Loop Until (temp = -1)
A. temp
2|Page
, ©BRIGHTSTARS EXAM SOLUTIONS
11/14/2024 12:19 PM
B. tot
C. check
D. -1 - answer✔B
Identify the loop control variable in the following loop block code segment.
Dim temp, tot, check As Integer
Do
temp = CInt(InputBox("Enter a number."))
tot += temp
check += 1
Loop Until (temp = -1)
A. temp
B. tot
C. check
D. -1 - answer✔A
Identify the sentinel value in the following loop block code segment.
Dim temp, tot, check As Integer
Do
temp = CInt(InputBox("Enter a number."))
tot += temp
check += 1
Loop Until (temp = -1)
A. temp
B. tot
C. check
D. -1 - answer✔D
3|Page
, ©BRIGHTSTARS EXAM SOLUTIONS
11/14/2024 12:19 PM
Identify the counter in the following loop block code segment.
Dim temp, tot, check As Integer
Do
temp = CInt(InputBox("Enter a number."))
tot += temp
check += 1
Loop Until (temp = -1)
A. temp
B. tot
C. check
D. -1 - answer✔C
What is wrong with the following Do loop?
Dim index As Integer = 1
Do While index <> 10
lstBox.Items.Add("Hello")
index += 2
Loop
A. It should have been written as a Do Until loop.
B. It is an infinite loop.
C. The test variable should not be changed within the loop itself.
D. Nothing - answer✔B
In a For statement of the form shown below, what is the default step value when the "Step c"
clause is omitted?
For i As Integer = a To b Step c
A. the same as a
B. the same as b
4|Page