# CIS170A Week 4 Quiz – Study Guide – 100% score for this study guide

Lab Price = \$9
P.S: This is just a study guide. The questions may not appear exactly like this.
Payment methods

Problem Statement

1. (TCO 5) Which of the following is a component of a repetition structure? (Points : 3)
An initial assignment of a counter or stopping variable
A condition that, when met, will stop the loop
An increment/decrement of the counter
All of the above

2. (TCO 5) When should a programmer select a For…Next loop for a program? (Points : 3)
When the programmer knows the exact number of times the loop will be executed
When the programmer knows the loop must be executed at least once
When the programmer is not sure how many times the loop will be executed
There is no reason to select a For… Next loop. Any loop can be used any time.

3. (TCO 5) The instructions in a Pretest loop will always be processed _____ or more times. (Points : 3)
three
two
one
zero

4. (TCO 10) Code walk-throughs are used to improve code. What action is NOT taken during a walk-through? (Points : 3)
Correcting syntax errors
Review of the parameters and data structures used
Identification of positive and negative elements of the code
Evaluation of the details of the code

5. (TCO 5) Floating-point variables, such as Double, should not be used _____. (Points : 3)
as counters that control loop execution
to perform mathematical calculations inside a loop
as approximate representations of decimal numbers
for applications when precision is required

6. (TCO 5) A loop that resides inside another loop is called an _____. (Points : 3)
outer loop
inner loop
infinite loop
None of the above

7. (TCO 5) An infinite loop occurs when _____. (Points : 3)
a loop counter does not converge on an exit condition
a loop counter does converge on an exit condition
one loop is nested inside another loop
three or more levels of nested loops exist

8. (TCO 5) Given the following partial program, how many times will the inner loop body (System.Console.WriteLine((outer*inner).ToString(“N0”))) be executed?

Dim inner, outer As Integer
For outer = 0 To 6
For inner = 1 To 4
System.Console.WriteLine((outer*inner).ToString(“N0”))
Next
Next (Points : 3)
10
11
24
28
None of the above

9. (TCO 5) How many times will HELLO be displayed when the following lines are executed?

For counter As Integer = 20 To -2 Step -4
System.Console.WriteLine(“HELLO”)
Next (Points : 3)
Two
Four
Six
Eight
None of the above

10. (TCO 5) How many times will the word HI be displayed when the following lines are executed?

Dim c As Integer = 12
Do
System.Console.WriteLine(“HI”)
c = c + 3
Loop Until (c >= 30) (Points : 3)
Four
Six
Nine
10

11. (TCO 5) Assume that counter and exitCondition are integer variables. Describe precisely the output produced by the following segment for the test inputs 8 and 3.

Dim counter As Integer
Dim exitCondition As Integer = 5

Do While (counter < exitCondition) System.Console.WriteLine(counter.ToString("N0")) counter = counter + 1 Loop (Points : 5)

Relevant Material
Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.