All papers

Computer Science · AQA 8525 · Paper 1: Computational thinking and programming skills · June 2019

AQA GCSE Computer Science Paper 1: Computational thinking and programming skills June 2019 question paper 8525/1

2h 90 marks

AQA 8525 · Paper 1

10 questions
Report a problem
What is wrong?

Goes to whoever maintains the question split. No account needed and nothing is published on this page.

Question 1

Figure for question 1

Shade one lozenge that shows the length of the contents of the variable level in Figure 1.

Figure for question 1

[1 mark]

Answer
Mark scheme for question 1.1

Shade one lozenge that shows the result of concatenating the variable title with the variable level in Figure 1.

Figure for question 1

[1 mark]

Answer
Mark scheme for question 1.2

Shade one lozenge to show which of the following strings is a substring of the variable title in Figure 1.

Figure for question 1

[1 mark]

Answer
Mark scheme for question 1.3

The Unicode character code of title[0], which is 'c', is 99.

Shade one lozenge to show the Unicode character code of the character level[3] in Figure 1.

Figure for question 1

[1 mark]

Answer
Mark scheme for question 1.4

Question 2

The three examples of code shown in Figure 2 are all equivalent to one another.

Figure for question 2

Shade one lozenge to show the statement that is true about Figure 2.

Figure for question 2

[1 mark]

Answer
Mark scheme for question 2.1

Explain why a developer, who is good at both low-level and high-level programming, would normally use high-level languages when writing programs.

[4 marks]

Answer
Mark scheme for question 2.2

Statements A and B refer to two different types of program translator.

Statement A: This type of translator can convert a high-level language program into machine code. The source code is analysed fully during the translation process. The result of this translation can be saved, meaning the translation process does not need to be repeated.

Statement B: This type of translator was used to convert the code in Example 2 to the code in Example 3 in Figure 2.

State the type of program translators referred to in statements A and B.

Statement A:

Statement B:

[2 marks]

Answer
Mark scheme for question 2.3

Question 3

Figure for question 3

Shade one lozenge to show which of the following lines of code correctly calculates the amount of flour needed in grams.

Figure for question 3

[1 mark]

Answer
Mark scheme for question 3.1

Shade one lozenge to show which programming technique has been used in all of the lines of code in Question 03.1.

Figure for question 3

[1 mark]

Answer
Mark scheme for question 3.2

The developer wants to use validation to ensure that the user can only enter a positive number of eggs, ie one egg or more. The maximum number of eggs that can be used in the recipe is eight.

Develop an algorithm, using either pseudo-code or a flowchart, so that the number of eggs is validated to ensure the user is made to re-enter the number of eggs used until a valid number is entered.

You should assume that the user will always enter an integer.

[4 marks]

Answer
Mark scheme for question 3.3

Question 4

Figure for question 4

[4 marks]

Answer
Mark scheme for question 4.1

State why both PA YLOAD_SIZE and HEADER_SIZE from the algorithm in Figure 4 did not need to be included in the trace table.

[1 mark]

Answer
Mark scheme for question 4.2

Shade one lozenge to show which of the following best represents the input and output to/from the algorithm in Figure 4.

Figure for question 4

[1 mark]

Answer
Mark scheme for question 4.3
Figure for question 4

[3 marks]

Answer
Mark scheme for question 4.4

Question 5

The expression (B AND (NOT A)) OR (B AND C) can be represented by the logic circuit shown in Figure 5. In the circuit the logic gates are marked with labels instead of their proper symbols.

Figure for question 5

State the name of the logic gate used at Gate 1 in Figure 5.

[1 mark]

Answer
Mark scheme for question 5.1

State the name of the logic gate used at Gate 2 in Figure 5.

[1 mark]

Answer
Mark scheme for question 5.2

Draw the logic circuit symbol in the space below for the logic gate used at Gate 3 in Figure 5.

[1 mark]

Answer
Mark scheme for question 5.3

Draw the logic circuit symbol in the space below for the logic gate used at Gate 4 in Figure 5.

[1 mark]

Answer
Mark scheme for question 5.4
Figure for question 5

[3 marks]

Answer
Mark scheme for question 5.5

A truth table for the complex Boolean expression: (A1 AND (NOT A2) AND A3) OR (A1 AND A2 AND A3) is shown in Figure 6.

Figure for question 5

Shade one lozenge which shows a simpler expression which is the equivalent of the original, more complex, expression.

Figure for question 5

[1 mark]

Answer
Mark scheme for question 5.6

Question 6

Run length encoding (RLE) is a form of compression that creates frequency/data pairs to describe the original data.

For example, an RLE of the bit pattern 00000011101111 could be 6 0 3 1 1 0 4 1 because there are six 0 s followed by three 1 s followed by one 0 and finally four 1 s.

The algorithm in Figure 7 is designed to output an RLE for a bit pattern that has been entered by the user.

Question 6, shown as an image

• Note that indexing starts at zero.

Figure 7

Question 6, shown as an image
Question 6, shown as an image
Figure for question 6

[1 mark]

Answer
Mark scheme for question 6.1
Question 6, shown as an image
Figure for question 6

[1 mark]

Answer
Mark scheme for question 6.2
Question 6, shown as an image
Figure for question 6

[1 mark]

Answer
Mark scheme for question 6.3
Question 6, shown as an image
Figure for question 6

[1 mark]

Answer
Mark scheme for question 6.4
Question 6, shown as an image
Figure for question 6

[1 mark]

Answer
Mark scheme for question 6.5
Figure for question 6

[2 marks]

Answer
Mark scheme for question 6.6

A developer implements the algorithm shown in Figure 7 and tests their code to check that it is working correctly. The developer tests it only with the input bit pattern that consists of six zeros and it correctly outputs 6 0.

Using example test data, state three further tests that the developer could use to improve the testing of their code.

[3 marks]

Answer
Mark scheme for question 6.7

Question 7

Figure for question 7

Shade one lozenge to show which programming technique is used on line 3 of the algorithm in Figure 8.

Figure for question 7

[1 mark]

Answer
Mark scheme for question 7.1

Shade one lozenge to show the data type of the variable ans in the algorithm in Figure 8.

Figure for question 7

[1 mark]

Answer
Mark scheme for question 7.2

Regardless of what the user inputs, the same number of OUTPUT instructions will always execute in the algorithm shown in Figure 8.

State how many OUTPUT instructions will execute whenever the algorithm is run.

[1 mark]

Answer
Mark scheme for question 7.3

The phrase ꞌ C ontact supplierꞌ appears twice in the algorithm in Figure 8.

State the two possible sequences of user input that would result in ꞌ C ontact supplierꞌ being output.

Sequence 1:

Sequence 2:

[2 marks]

Answer
Mark scheme for question 7.4

Another developer looks at the algorithm shown in Figure 8 and makes the following statement.

“At the moment if the user enters ‘y’ or ‘n’ they will sometimes get unexpected results. This problem could have been avoided.”

Explain why this problem has occurred and describe what would happen if a user entered ‘y’ or ‘n’ instead of ‘yes’ or ‘no’.

You may include references to line numbers in the algorithm where appropriate. You do not need to include any additional code in your answer.

[3 marks]

Answer
Mark scheme for question 7.5

Question 8

Figure for question 8

[3 marks]

Answer
Mark scheme for question 8.1

For a binary search algorithm to work correctly on an array of integers, what property must be true about the array?

[1 mark]

Answer
Mark scheme for question 8.2

Question 9

Figure for question 9

[6 marks]

Answer
Mark scheme for question 9

Question 10

Figure for question 10

The subroutine in Figure 10 uses the values true and false. Each element of the array board has the value 0, 1 or 2.

State the most appropriate data type for these values.

Figure for question 10

[2 marks]

Answer
Mark scheme for question 10.1

The developer has taken the overall problem of the game Battleships and has broken it down into smaller sub-problems.

State the technique that the developer has used.

[1 mark]

Answer
Mark scheme for question 10.2

The identifier for the subroutine in Figure 10 is F. This is not a good choice. State a better identifier for this subroutine and explain why you chose it.

New subroutine identifier:

Question 10, shown as an image

[2 marks]

Answer
Mark scheme for question 10.3
Figure for question 10

[2 marks]

Answer
Mark scheme for question 10.4

Develop a subroutine that works out how far away the game is from ending.

The subroutine should:

maths symbol have a sensible identifier

maths symbol take the board as a parameter

maths symbol work out and output how many hits have been made

maths symbol work out how many locations containing a ship have yet to be hit and: o if 0 then output 'Winner' o if 1, 2 or 3 then output 'Almost there'.

[11 marks]

Answer
Mark scheme for question 10.5

The paper as printed

Spotted a mistake on this page?Report a problem