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
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
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
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
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Brightstars. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $12.49. You're not tied to anything after your purchase.