For each of the pseudocode algorithms shown below, tick the appropriate box to show whether they will loop infinitely or not - OCR - GCSE Computer Science - Question 6 - 2018 - Paper 1
Question 6
For each of the pseudocode algorithms shown below, tick the appropriate box to show whether they will loop infinitely or not.
1.
x = 0
while True
prin... show full transcript
Worked Solution & Example Answer:For each of the pseudocode algorithms shown below, tick the appropriate box to show whether they will loop infinitely or not - OCR - GCSE Computer Science - Question 6 - 2018 - Paper 1
Step 1
1. Will loop infinitely
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Tick the box for 'Will loop infinitely'. The condition 'while True' means this loop will never terminate.
Step 2
2. Will not loop infinitely
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Tick the box for 'Will not loop infinitely'. The loop will execute until x becomes 10.
Step 3
3. Will not loop infinitely
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Tick the box for 'Will not loop infinitely'. This loop increments x each time and will terminate once x is no longer less than 10.
Step 4
4. Will not loop infinitely
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Tick the box for 'Will not loop infinitely'. The for loop will execute exactly 5 times for values 1 to 5.
Step 5
Using pseudocode write an algorithm that will use a count-controlled loop to print out the numbers 1 to 10 in ascending order.
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!