Lesson details

Key learning points

  1. In this lesson, we will extend and improve a guess the number game. This will consolidate the learning that has taken place in this unit of work.

Licence

This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.

Loading...

3 Questions

Q1.
How many times will line 3 be executed?
An image in a quiz
1
Correct answer: 3
4
Infinitely (the condition in line 2 will never become False)
None (the condition in line 2 will be False the first time it is checked)
Q2.
How many times will line 3 be executed?
An image in a quiz
1
3
4
Correct answer: Infinitely (the condition in line 2 will never become False)
None (the condition in line 2 will be False the first time it is checked)
Q3.
How many times will line 3 be executed?
An image in a quiz
1
3
Correct answer: 4
Infinitely (the condition in line 2 will never become False)
None (the condition in line 2 will be False the first time it is checked)

10 Questions

Q1.
When this program is executed, what will be displayed on the screen if the user enters 0 at the prompt?
An image in a quiz
Correct answer: 0 is negative
0 is positive
Option 1
The program will not display anything because 0 is neither positive nor negative.
Q2.
When this program is executed, what will be displayed on the screen, if the user enters 0 at the prompt?
An image in a quiz
0 is non-zero
0 is zero
0 is zero, 0 is non-zero
Correct answer: There is a syntax error in the condition in line 3.
Q3.
When this program is executed, what will be displayed on the screen, if the user enters 30 at the prompt?
An image in a quiz
30 minutes is 0.5 hours
Correct answer: 30 minutes is less than an hour
30 minutes is less than an hour, 30 minutes is 0.5 hours
There is a syntax error in the condition in line 3.
Q4.
When this program is executed, what will be displayed on the screen, if the user enters 90 at the prompt?
An image in a quiz
Correct answer: 90 minutes is 1.5 hours
90 minutes is less than an hour
90 minutes is less than an hour, 90 minutes is 1.5 hours
There is a syntax error in the condition in line 3.
Q5.
When this program is executed, what will be displayed on the screen, if the user enters 90 at the prompt?
An image in a quiz
90 minutes is 1.5 hours
Correct answer: 90 minutes is less than an hour
90 minutes is less than an hour, 90 minutes is 1.5 hours
There is a syntax error in the condition in line 3.
Q6.
When this program is executed, what will be displayed on the screen?
An image in a quiz
large
Correct answer: medium
medium, large
small
Q7.
How many times will line 4 be executed?
An image in a quiz
1
10
Infinitely (the condition in line 2 will never become False)
Correct answer: It is impossible to determine in advance
None (the condition in line 2 will be False the first time it is checked)
Q8.
When this program is executed, what will be displayed on the screen, as a result of executing line 5?
An image in a quiz
1
Correct answer: 10
It is impossible to determine in advance
There is an error in the program, because line 5 should have been indented
Q9.
When this program is executed, how many times will line 4 be executed?
An image in a quiz
Line 4 will be executed 1357 times.
Line 4 will be executed an infinite number of times (the while loop will never terminate).
Correct answer: Line 4 will be executed at least once.
Line 4 will be executed once.
Q10.
When this program is executed, how many times will line 4 be executed?
An image in a quiz
Line 4 will be executed 1357 times.
Correct answer: Line 4 will be executed an infinite number of times (the while loop will never terminate).
Line 4 will be executed at least once.
Line 4 will be executed once.