What is a repetition structure? 2 What is a condition-controlled loop? 3 What is a count-controlled loop? 4 What is a loop iteration? 5 What is the difference between a pretest loop and a posttest loop? 6 Does the While loop test its condition before or after it performs an iteration? 7 Does the Do-While loop test its condition before or after it performs an iteration? 8 What is an infinite loop? 9 What is the difference between a Do-While loop and a Do-Until loop? 10 What is a counter variable? 11 What three actions do count-controlled loops typically perform using the counter variable? 12 When you increment a variable, what are you doing? When you decrement a variable, what are you doing? 13 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer number = 5 Set number = number + 1 Display number 14 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter For counter = 1 To 5 Display counter End For 15 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter For counter = 0 To 500 Step 100 Display counter End For 16 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter = 1 Constant Integer MAX = 8 While counter <= MAX Display counter Set counter = counter + 1 End While 17 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter = 1 Constant Integer MAX = 7 While counter <= MAX Display counter Set counter = counter + 2 End While 18 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter Constant Integer MIN = 1 For counter = 5 To MIN Step –1 Display counter End For 19 A program that calculates the total of a series of numbers typically has what two elements? 20 What is an accumulator? 21 Should an accumulator be initialized to any specific value? Why or why not? 22 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer number1 = 10, number2 = 5 Set number1 = number1 + number2 Display number1 Display number2 23 Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter, total = 0 For counter = 1 To 5 Set total = total + counter End For Display total 24 What is a sentinel? 25 Why should you take care to choose a unique value as a sentinel?
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
What is a repetition structure?
2 What is a condition-controlled loop?
3 What is a count-controlled loop?
4 What is a loop iteration?
5 What is the difference between a pretest loop and a posttest loop?
6 Does the While loop test its condition before or after it performs an iteration?
7 Does the Do-While loop test its condition before or after it performs an iteration?
8 What is an infinite loop?
9 What is the difference between a Do-While loop and a Do-Until loop?
10 What is a counter variable?
11 What three actions do count-controlled loops typically perform using the counter variable?
12 When you increment a variable, what are you doing? When you decrement a variable, what are you doing?
13 Look at the following pseudocode. If it were a real
Declare Integer number = 5
Set number = number + 1
Display number
14 Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer counter
For counter = 1 To 5
Display counter
End For
15 Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer counter
For counter = 0 To 500 Step 100
Display counter
End For
16 Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer counter = 1
Constant Integer MAX = 8
While counter <= MAX
Display counter
Set counter = counter + 1
End While
17 Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer counter = 1
Constant Integer MAX = 7
While counter <= MAX
Display counter
Set counter = counter + 2
End While
18 Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer counter
Constant Integer MIN = 1
For counter = 5 To MIN Step –1
Display counter
End For
19 A program that calculates the total of a series of numbers typically has what two elements?
20 What is an accumulator?
21 Should an accumulator be initialized to any specific value? Why or why not?
22 Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer number1 = 10, number2 = 5
Set number1 = number1 + number2
Display number1
Display number2
23 Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer counter, total = 0
For counter = 1 To 5
Set total = total + counter
End For
Display total
24 What is a sentinel?
25 Why should you take care to choose a unique value as a sentinel?
Trending now
This is a popular solution!
Step by step
Solved in 3 steps