←

Logic, algorithms and problem solving

From Mock A · Paper 1: Written examination
12(b)1 mark
Give the line number where selection is used in the program in 12(a).
From Mock A · Paper 1: Written examination
12(c)1 mark
State the output of the program in 12(a).
From Mock A · Paper 1: Written examination
12(d)2 marks
Explain the purpose of the loop on line 3 of the program in 12(a).
From Mock B · Paper 1: Written examination
12(a)1 mark
This program checks a password.
1  password = input("Enter password: ")2  attempts = 13  while password != "Plasmo7" and attempts < 3:4      password = input("Try again: ")5      attempts = attempts + 16  if password == "Plasmo7":7      print("Access granted")8  else:9      print("Locked out")
State the line number where iteration begins.
From Mock B · Paper 1: Written examination
12(c)2 marks
A user enters `abc`, then `123`, then `xyz`. State the output of the program in 12(a) and the final value of `attempts`.
From Mock B · Paper 1: Written examination
12(d)2 marks
Explain why the keyword `and` is used on line 3.
From Mock B · Paper 1: Written examination
12(e)2 marks
Using line numbers from the program, explain the difference between sequence and selection.
From Mock C · Paper 1: Written examination
31 mark
What is an algorithm?
From Mock C · Paper 1: Written examination
12(a)2 marks
An agent must find a route through this grid from S to E. It can move Up, Down, Left or Right one square at a time. # is a wall.
     col1 col2 col3 col4row1  S    .    .    #row2  #    #    .    #row3  .    .    .    .row4  #    E    #    .
Write the shortest sequence of moves from S to E.
From Mock C · Paper 1: Written examination
12(b)1 mark
State the number of moves in the shortest route in 12(a).
From Mock C · Paper 1: Written examination
14(a)3 marks
def classify_temp(t):    if t < 10:        return "cold"    elif t < 25:        return "mild"    else:        return "hot" readings = [8, 25, 17]for r in readings:    print(classify_temp(r))
State the output of this program.
From Mock D · Paper 1: Written examination
41 mark
Which logical structure is used when a program chooses between two different paths?
From Mock D · Paper 1: Written examination
13(a)1 mark
temps = [14, 18, 21, 19, 25]total = 0for t in temps:    total = total + taverage = total / len(temps)print(average)
State the output of this program.
From Mock D · Paper 1: Written examination
13(b)2 marks
Identify the iteration construct in the program in 13(a) and describe what it does.
From Mock E · Paper 1: Written examination
41 mark
What is decomposition?
From Mock E · Paper 1: Written examination
16(a)3 marks
names = ["Ana", "Ben", "Cal"]scores = [72, 58, 91]for i in range(len(names)):    if scores[i] >= 60:        print(names[i], "pass")    else:        print(names[i], "retake")
State the output of this program.
From Mock F · Paper 1: Written examination
41 mark
Which expression is True only when `a` is greater than 5 and `b` is less than 3?
From Mock F · Paper 1: Written examination
15(a)1 mark
def count_vowels(word):    count = 0    for letter in word.lower():        if letter in "aeiou":            count = count + 1    return count print(count_vowels("Robot"))
State the output of this program.
Score 0 / 28 · 0 of 18 marked

This paper is written by Plasmo in the style of the LRN GCSE Artificial Intelligence exam. It is not a past paper and is not produced or endorsed by the exam board.

Logic, algorithms and problem solving Exam Questions: LRN GCSE Artificial Intelligence | Plasmo