All papers

Computer Science · AQA 8525 · Paper 1: Computational thinking and programming skills · November 2020

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

2h 90 marks

AQA 8525 · Paper 1

12 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

A bitmap image is represented as a grid of pixels.

State what is meant by the term pixel.

[1 mark]

Answer
Mark scheme for question 1.1

State the maximum number of different colours that can be used if a bitmap image has a colour depth of six bits.

[1 mark]

Answer
Mark scheme for question 1.2

What is the minimum file size for an 800 pixel by 1000 pixel bitmap image that uses 20 different colours? You should give your answer in kilobytes.

You should show your working.

[3 marks]

Answer
Mark scheme for question 1.3

The algorithm shown in Figure 1 converts binary data entered as a string by the user into a representation of a black and white image.

The algorithm uses the + operator to concatenate two strings. Characters in the string are indexed starting at zero. For example bdata[2] would access the third character of the string stored in the variable bdata The MOD operator calculates the remainder after integer division, for example 17 MOD 5 = 2

Figure 1

Question 1, shown as an image

Complete the trace table for the algorithm shown in Figure 1 when the variable bdata is given the following value from the user: 110101

You may not need to use every row in the table. The algorithm output is not required.

Figure for question 1

[3 marks]

Answer
Mark scheme for question 1.4

Question 2

Describe how the linear search algorithm works.

[3 marks]

Answer
Mark scheme for question 2

Question 3

State the name of the logic gate represented by the following truth table.

Input AInput BOutput
000
010
100
111

Logic gate

[1 mark]

Answer
Mark scheme for question 3.1

A partially complete logic circuit is shown in Figure 2 that detects if a computer system has been set up correctly. There are two keyboard input devices, keyboard A and keyboard B, and either one can be connected to the computer system. However, if they are both connected then the computer system will not work.

Output P has the value 1 if either keyboard A or keyboard B, but not both, is connected to the computer system and 0 otherwise.

Figure for question 3

State the name of the logic gates that should be placed in the positions indicated by the labels L1, L2, L3 and L4 in Figure 2.

Figure for question 3

[3 marks]

Answer
Mark scheme for question 3.2

Question 4

Figure for question 4

Shade one lozenge to show the most appropriate data type of the variable i in the algorithm in Figure 3.

Figure for question 4

[1 mark]

Answer
Mark scheme for question 4.1

State the data type of the variable valid in the algorithm in Figure 3.

[1 mark]

Answer
Mark scheme for question 4.2
Figure for question 4

[3 marks]

Answer
Mark scheme for question 4.3

State what an assembly language program must be translated into before it can be executed by a computer.

[1 mark]

Answer
Mark scheme for question 4.4

State two reasons why a programmer, who can program in both high-level and low-level languages, would usually choose to develop in a high-level language rather than a low-level language.

Reason 1

Reason 2

[2 marks]

Answer
Mark scheme for question 4.5

Develop an algorithm, using either pseudo-code or a flowchart, that:

• initialises a variable called regValid to False

Question 4, shown as an image

Examples:

Question 4, shown as an image
Question 4, shown as an image

You may wish to use the subroutine isDigit(ch) in your answer. The subroutine isDigit returns True if the character parameter ch is a string representation of a digit and False otherwise.

[3 marks]

Answer
Mark scheme for question 4.6

Question 5

Figure for question 5

Complete the trace table for the algorithm shown in Figure 4 when the initial value of number is 4

You may not need to use all rows of the trace table.

Figure for question 5

[2 marks]

Answer
Mark scheme for question 5.1

Complete the trace table for the algorithm shown in Figure 5 when the initial value of number is 4

You may not need to use all rows of the trace table.

Figure for question 5

[2 marks]

Answer
Mark scheme for question 5.2

The algorithms in Figure 4 and Figure 5 have the same purpose.

State this purpose.

[1 mark]

Answer
Mark scheme for question 5.3

Explain why the algorithm shown in Figure 4 can be considered to be a more efficient algorithm than the algorithm shown in Figure 5.

[1 mark]

Answer
Mark scheme for question 5.4

Question 6

Show the steps involved, for either the bubble sort algorithm or the merge sort algorithm, to sort the array shown in Figure 6 so the result is [1, 4, 5, 8]

Figure 6

[8, 4, 1, 5]

Circle the algorithm you have chosen:

Bubble sort
Merge sort

Question 6, shown as an image

[4 marks]

Answer
Mark scheme for question 6

Question 7

Figure for question 7 Figure for question 7

[4 marks]

Answer
Mark scheme for question 7.1

Describe how the developer has used the structured approach to programming in Figure 7.

[2 marks]

Answer
Mark scheme for question 7.2

Question 8

The subroutine CODE_TO_CHAR can be used to convert a character code into the corresponding Unicode character. For example:

CODE_TO_CHAR(97) will return the character 'a' CODE_TO_CHAR(65) will return the character 'A' The subroutine CHAR_TO_CODE can be used to convert a Unicode character into the corresponding character code. For example:

CHAR_TO_CODE('a') will return the integer 97 CHAR_TO_CODE('A') will return the integer 65

Shade one lozenge to show what value would be returned from the subroutine call CODE_TO_CHAR(100)

Figure for question 8

[1 mark]

Answer
Mark scheme for question 8.1

State the value that will be returned from the subroutine call:

CODE_TO_CHAR(CHAR_TO_CODE('E') + 2)

Value returned

[1 mark]

Answer
Mark scheme for question 8.2

Write a subroutine TO_LOWER, using either pseudo-code or a flowchart, that takes an upper case character as a parameter and returns the corresponding lower case character. For example, if the subroutine TO_LOWER is passed the character ' A ' as a parameter, the subroutine should return the character ' a '. You should make use of the subroutines CODE_TO_CHAR and CHAR_TO_CODE in your answer.

You can assume that the parameter passed to the subroutine will be in upper case.

[5 marks]

Answer
Mark scheme for question 8.3

Question 9

A developer needs to store data about thousands of songs in a program. She needs to be able to hold information on every song’s title, singer and year of release.

Explain how the developer could use a combination of an array and records to store this information.

In your answer you should refer to the data types that would be used by the developer.

[4 marks]

Answer
Mark scheme for question 9

Question 10

An application allows only two users to log in. Their usernames are stated in Table 1 along with their passwords.

Figure for question 10

Develop an algorithm, using either pseudo-code or a flowchart, that authenticates the user. The algorithm should:

• get the user to enter their username and password

• check that the combination of username and password is correct and, if so, output the string 'access granted'

• get the user to keep re-entering their username and password until the combination is correct.

[6 marks]

Answer
Mark scheme for question 10

Question 11

Develop an algorithm, using either pseudo-code or a flowchart, that helps an ice cream seller in a hot country calculate how many ice creams they are likely to sell on a particular day. Your algorithm should:

• get the user to enter whether it is the weekend or a weekday

• get the user to enter the temperature forecast in degrees Celsius (they should enter a number between 20 and 45 inclusive; if the number falls outside of this range then they should be made to re-enter another number until they enter a valid temperature)

• calculate the number of ice creams that are likely to be sold using the following information: o 100 ice creams are likely to be sold if the temperature is between 20 and 30 degrees inclusive, o 150 ice creams are likely to be sold if the temperature is between 31 and 38 degrees inclusive, o and 120 ice creams are likely to be sold if the temperature is higher than 38 degrees

• double the estimate if it is a weekend

• output the estimated number of ice creams that are likely to be sold.

[9 marks]

Answer
Mark scheme for question 11

Question 12

A developer has written a set of subroutines to control an array of lights. The lights are indexed from zero. They are controlled using the subroutines in Table 2.

Figure for question 12

Array indices are shown above the array of lights.

For example, if the starting array of the lights is

0123
offonoffon

Then after the subroutine call SWITCH(2) the array of lights will become

0123
offononon

And then after the subroutine call NEIGHBOUR(0) the array of lights will become

0123
onononon

Finally, after the subroutine call RANGEOFF(0, 3) the array of lights will become

0123
onoffoffon

If the starting array of lights is

Figure for question 12

What will the array of lights become after the following algorithm has been followed?

Question 12, shown as an image

Write your final answer in the following array

Figure for question 12

[3 marks]

Answer
Mark scheme for question 12.1

If the starting array of lights is

Figure for question 12

What will the array of lights become after the following algorithm has been followed?

Question 12, shown as an image

Write your final answer in the following array

Figure for question 12

[3 marks]

Answer
Mark scheme for question 12.2

If the starting array of lights is

Figure for question 12

What will the array of lights become after the following algorithm has been followed?

Question 12, shown as an image

Write your final answer in the following array

Question 12, shown as an image

[3 marks]

Answer
Mark scheme for question 12.3

If the starting array of lights is

Figure for question 12

Write an algorithm, using exactly three subroutine calls, that means the final array of lights will be

Figure for question 12

You must use each of the subroutines SWITCH, NEIGHBOUR and RANGEOFF exactly once in your answer. If you do not do this you may still be able to get some marks.

[3 marks]

Answer
Mark scheme for question 12.4

The paper as printed

Spotted a mistake on this page?Report a problem