Yofile59

CLICK HERE TO DOWNLOAD THIS ANSWER INSTANTLY

1. (TCO 5) A _____ repeats actions until a certain condition is met. (Points : 3)
repetition structure
control structure
selection structure
sequence structure
2. (TCO 5) You are writing a For…Next loop. Which of the following is valid for an initial or terminating value? (Points : 3)
The value stored in a variable declared as an Integer
info.Length, where info is a String variable
10
All of the above
3. (TCO 5) When is the loop condition evaluated in a Pretest? (Points : 3)
Before executing the loop task
After executing the loop task
During execution of the loop task
It depends on the contents of the loop task.
4. (TCO 10) The process during which we review the details of a program with our peers in order to improve it is called a _____. (Points : 3)
code evaluation
code walk-through
code revision
code inspection
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 contains a separate inner loop in its execution code is called an _____. (Points : 3)
outer loop
inner loop
infinite loop
None of the above
7. (TCO 5) A loop that never stops executing is called _____. (Points : 3)
a nested loop
an infinite loop
a Pretest loop
a Posttest loop
8. (TCO 5) Given the following partial program, how many times will the inner loop body (System.Console.WriteLine((num1 + num2).ToString(“N0”))) be executed?
Dim num1, num2 As Integer
For num1 = 1 To 3
For num = 0 To 2
System.Console.WriteLine((num1 + num2).ToString(“N0”))
Next
Next (Points : 3)
Five
Six
Eight
16
None of the above
9. (TCO 5) How many times will DOG be displayed when the following lines are executed?
For counter As Integer = 13 To -3 Step -6
System.Console.WriteLine(“DOG”)
Next (Points : 3)
Two
Three
Four
Five
None of the above
10. (TCO 5) What numbers will be displayed by the following code?
Dim num As Integer = 7
Do
num += 1
System.Console.WriteLine(num.ToString(“N0”))
Loop Until (num > 6)
System.Console.WriteLine(num.ToString(“N0”)) (Points : 3)
7
8
7 and 8
8 and 8
11. (TCO 5) Assume that “i” and “last” are integer variables. Describe precisely the output produced by the following segment for the test inputs 4 and -2.
Dim last As Integer
Dim i As Integer = 0
last = CInt(System.Console.ReadLine())
Do While (i < last)
System.Console.WriteLine(i.ToString(“N0”))
i = i + 1
Loop (Points : 5)