←

Paper 1: Computational thinking and programming skills

11 mark
Which one of the following best describes abstraction?
21 mark
Which data type is most suitable for storing a person's height in metres?
3.13 marks
The algorithm below is written in AQA pseudo-code.
total ← 0FOR i ← 1 TO 5  IF i MOD 2 = 1 THEN    total ← total + i  ENDIFENDFOROUTPUT total
State the value of total at the end of each iteration of the FOR loop, and the final output.
3.21 mark
State the purpose of the algorithm in 03.1.
4.12 marks
Explain why a binary search cannot be used on the list [19, 3, 40, 8, 25].
4.23 marks
Show the steps a binary search takes to find 31 in the list [3, 8, 12, 19, 25, 31, 40].
4.32 marks
Compare the efficiency of linear search and binary search on a large sorted list.
5.12 marks
Show the result of the first pass of a bubble sort (ascending) on the list [7, 3, 9, 1].
5.22 marks
Give one advantage and one disadvantage of merge sort compared with bubble sort.
66 marks
Write a program that asks the user to enter a password and keeps asking until the password is at least 8 characters long. It should then output 'Accepted'. You may use AQA pseudo-code or a high-level language.
7.11 mark
The subroutine below calculates the area of a rectangle.
SUBROUTINE area(w, h)  RETURN w * hENDSUBROUTINE
Identify one parameter used in the subroutine.
7.22 marks
Explain one advantage of using local variables in subroutines.
7.33 marks
Write a subroutine called perimeter that takes the width and height of a rectangle and returns its perimeter.
8.11 mark
An array is declared: scores ← [12, 45, 7, 30, 21]. Arrays are indexed from 0. State the value of scores[2].
8.26 marks
Write an algorithm that finds the highest value in scores and the index where it is stored, and outputs both.
9.11 mark
name ← 'Plasmo'. State the value returned by LEN(name).
9.21 mark
In AQA pseudo-code, SUBSTRING(start, end, string) returns characters from position start to end inclusive (from 0). State the value of SUBSTRING(0, 2, name).
9.34 marks
Write an algorithm that counts the number of vowels (a, e, i, o, u) in a string entered by the user and outputs the count.
10.14 marks
Write code that asks for a mark between 0 and 100 inclusive and repeats the request until a valid mark is entered.
10.22 marks
Explain the difference between validation and verification.
10.35 marks
Write an authentication routine. The stored username is 'admin' and password is 'Plasm0!'. The user has three attempts; output 'Welcome' if correct or 'Locked' after three failures.
11.13 marks
A program accepts ages from 11 to 16 inclusive. Give one example each of normal, boundary and erroneous test data.
11.22 marks
Explain the difference between a syntax error and a logic error.
126 marks
Write a program that simulates rolling two six-sided dice 1,000 times and outputs how many times the total was 7. Use RANDOM_INT(1, 6) for a random integer from 1 to 6.
13.11 mark
A 2D array is declared: grid ← [[3, 5, 2], [8, 1, 4]]. State the value of grid[1][2] (row, column, indexed from 0).
13.24 marks
Write an algorithm that outputs the total of every value in grid.
149 marks
A cinema charges £6 for children (under 12), £7 for seniors (65 and over) and £10 for everyone else. Write a program that: asks how many tickets are needed; asks for the age of each person; calculates the total cost; applies a 20% discount if the user says it is Tuesday; outputs the total cost.
15.12 marks
Explain what is meant by a structured approach to programming.
15.23 marks
Trace the algorithm and state the output.
n ← 13count ← 0WHILE n ≠ 1  IF n MOD 2 = 0 THEN    n ← n DIV 2  ELSE    n ← 3 * n + 1  ENDIF  count ← count + 1ENDWHILEOUTPUT count
16.11 mark
x ← 7. State whether (x > 5 AND x < 10) OR x = 0 is True or False.
16.22 marks
Write a selection statement that outputs 'Teen' if age is between 13 and 19 inclusive.
17.12 marks
Explain why a programmer might use a FOR loop rather than a WHILE loop.
17.22 marks
Give two benefits of using subroutines.

Finished?

Answer every question to finish (33 left), or finish when the time’s up.

Score 0 / 90 · 0 of 33 marked

This paper is written by Plasmo in the style of the AQA GCSE Computer Science exam. It is not a past paper and is not produced or endorsed by the exam board.

AQA GCSE Computer Science Mock Exam: Paper 1: Computational thinking and programming skills | Plasmo