1 In the pseudocode below What will the final value of count
1) In the pseudocode below:
What will the final value of counter be?
2) In the pseudocode below:
How many times will the statement counter = counter + 1 be executed?
3) True or False: Some For loops cannot be rewritten as While loops.
False
4) Which of the following types of logic can be included inside of a loop (check all that apply):
If statements
Module and function calls
Other loops
Module and function definitions
Sequences of statements
5) What kind of loop is this?
Post-test while loop.
Pre-test while loop.
Pre-test until loop.
For loop.
6) What type of loop is this?
Pre-test until loop.
Pre-test while loop.
Post-test until loop.
For loop.
Post-test while loop.
7) True or False: For any integer value of temperature, the following two pieces of pseudocode always return the same results.
Hint: What output will be produced for the following values of temperature: 59; 60; 61? Are these outputs the same for both versions of the pseudocode?
Pseudocode A:
Pseudocode B:
False
| True | |||||||||||||||||||||||||||||||||
| False 4) Which of the following types of logic can be included inside of a loop (check all that apply):
|
Solution
1)counter will increment 9 times and condition breaks when conter value is 10
2) it is executed 9 times
3)true
4) option A B C E
5)option A - post test while loop
6)option B - pre test while loop
7)false ,both produce unequal input

