All papers

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

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

2h 90 marks

AQA 8525 · Paper 1

15 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

Which pseudo-code statement assigns the length of the string film to a variable called value ?

Shade one lozenge.

Question 1, shown as an image
Question 1, shown as an image
Question 1, shown as an image
Question 1, shown as an image

[1 mark]

Answer
Mark scheme for question 1.1

The POSITION subroutine returns the position of the first occurrence of a character in a string.

For example:

• POSITION("Godzilla vs. Kong", "o") would return 1

• POSITION("Godzilla vs. Kong", "z") would return 3

letter and film are variables used in the algorithm in Figure 1.

Complete the pseudo-code statement to find the position of the first occurrence of the contents of letter in film and store this position in the variable location You must use the POSITION subroutine in your answer.

location

[1 mark]

Answer
Mark scheme for question 1.2

Which of the following would be the most suitable data type for the variable year ?

Shade one lozenge.

Question 1, shown as an image
Question 1, shown as an image
Question 1, shown as an image
Question 1, shown as an image

[1 mark]

Answer
Mark scheme for question 1.3

Describe what is meant by an assignment statement in a program.

[1 mark]

Answer
Mark scheme for question 1.4

Write a C# program that:

maths symbol gets the user to enter the name of a film

maths symbol displays You entered followed by the name of the film entered by the user.

The output from the program must be on one line.

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code accurately.

Figure for question 1

[2 marks]

Answer
Mark scheme for question 1.5

Question 2

Figure for question 2

Where is a relational operator first used in the algorithm in Figure 2 ?

Shade one lozenge.

Question 2, shown as an image
Question 2, shown as an image
Question 2, shown as an image
Question 2, shown as an image

[1 mark]

Answer
Mark scheme for question 2.1

In the algorithm in Figure 2, what will be the output when the user input is 5 ?

Shade one lozenge.

Question 2, shown as an image
Question 2, shown as an image
Question 2, shown as an image
Question 2, shown as an image

[1 mark]

Answer
Mark scheme for question 2.2

Which value input by the user would result in True being output by the algorithm in Figure 2 ?

Shade one lozenge.

Question 2, shown as an image
Question 2, shown as an image
Question 2, shown as an image

[1 mark]

Answer
Mark scheme for question 2.3

Rewrite line 2 from the algorithm in Figure 2 without using the NOT operator.

The algorithm must still have the same functionality.

[1 mark]

Answer
Mark scheme for question 2.4

A user inputs a value into the algorithm in Figure 2.

State one value that the user could input that would result in an output of Unknown

[1 mark]

Answer
Mark scheme for question 2.5

Question 3

Figure for question 3

The program should generate a random number between 1 and 100 (including 1 and 100). This will be the number the user has to guess.

Write the C# code that should be used on line 3 in Figure 3 to:

• generate a random number between 1 and 100 inclusive

• assign this number to the appropriate variable from the program.

You must use rGen.Next(a, b) in your C# code. rGen.Next(a, b) generates a random integer in the range a to b starting at a but finishing one before b

[2 marks]

Answer
Mark scheme for question 3.1

Complete the test plan in Table 1 to test the validation of userNumber in the program in Figure 3.

Figure for question 3

[2 marks]

Answer
Mark scheme for question 3.2

In an earlier version of the program in Figure 3, line 6 contained one syntax error and one logic error:

whil (userNumber < 1 || userNumber >= 100)

Complete the table to describe the errors in the program on line 6.

Figure for question 3

[2 marks]

Answer
Mark scheme for question 3.3

Question 4

Define the term abstraction.

[1 mark]

Answer
Mark scheme for question 4.1

State the name for the process of breaking a problem down into sub-problems.

[1 mark]

Answer
Mark scheme for question 4.2

Question 5

Figure for question 5

[3 marks]

Answer
Mark scheme for question 5

Question 6

A university is writing a program to calculate a student’s total mark for three essays.

If any essays are handed in late, the total mark is reduced.

Write a C# program to calculate the total mark.

You should assume there are three integer variables called e1, e2 and e3 which have already been given values to represent the marks of the three essays.

The program should:

maths symbol get the user to enter the number of essays handed in late and store the number in a variable

maths symbol calculate the total mark for the three essays o if only one essay is handed in late, the total mark is reduced by 10 o if more than one essay is handed in late, the total mark should be halved o the total mark should not be less than 0

maths symbol output the total mark.

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code.

Figure for question 6

[7 marks]

Answer
Mark scheme for question 6

Question 7

A shop owner wants to create stock codes for each type of sweet they sell.

Figure 5 shows some of the sweets.

Figure for question 7

A stock code is made up of the:

maths symbol sweetID

maths symbol first letter and the second letter in sweetName

maths symbol first letter of the brand

For example:

maths symbol the stock code for WINE GUMS would be S1WIM

maths symbol the stock code for STARBURST would be S3STW

Write a C# program to create the stock code for a sweet.

The program should:

maths symbol get the user to enter the sweetID, sweetName and brand

maths symbol create the stock code

maths symbol assign the stock code to a variable called code

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code.

Figure for question 7

[4 marks]

Answer
Mark scheme for question 7

Question 8

Figure for question 8

[6 marks]

Answer
Mark scheme for question 8

Question 9

Which of the following best describes a data structure ?

Shade one lozenge.

Question 9, shown as an image
Question 9, shown as an image
Question 9, shown as an image
Question 9, shown as an image

[1 mark]

Answer
Mark scheme for question 9.1
Figure for question 9

[3 marks]

Answer
Mark scheme for question 9.2

Write an algorithm using pseudo-code to display the name of the most expensive book.

The algorithm should:

• compare the price of B1 and the price of B2

• output the book name of the most expensive book

• output Neither if the books are the same price.

The algorithm should work for any values stored in B1 and B2

[3 marks]

Answer
Mark scheme for question 9.3

Question 10

Figure for question 10

State what will be displayed by the Console.WriteLine statement when the subroutine First is called with the values 3, 4 and 4 for the parameters p1, p2 and p3

[1 mark]

Answer
Mark scheme for question 10.1

State what will be displayed by the Console.WriteLine statement when the subroutine First is called with the values 3, 4 and 8 for the parameters p1, p2 and p3

[1 mark]

Answer
Mark scheme for question 10.2

Question 11

A program is to be written to authenticate a username and password entered by the user.

Figure 9 shows the only two pairs of valid usernames and passwords.

Figure for question 11

Write a C# program to authenticate a username and password.

The program should:

maths symbol get the user to enter a username

maths symbol get the user to enter a password

maths symbol display the message Access denied if the username and password pair entered is not valid

maths symbol display the message Access granted if the username and password pair entered is valid

maths symbol repeat until a valid username and password pair is entered.

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code accurately.

Figure for question 11

[7 marks]

Answer
Mark scheme for question 11

Question 12

A program is being written to solve a sliding puzzle.

maths symbol The sliding puzzle uses a 3 x 3 board.

maths symbol The board contains eight tiles and one blank space.

maths symbol Each tile is numbered from 1 to 8

maths symbol On each turn, a tile can only move one position up, down, left, or right.

maths symbol A tile can only be moved into the blank space if it is next to the blank space.

maths symbol The puzzle is solved when the tiles are in the correct final positions.

Figure 10 shows an example of how the tiles might be arranged on the board at the start of the game with the blank space in the position (0, 1).

Figure 11 shows the correct final positions for the tiles when the puzzle is solved.

The blank space (shown in black) is represented in the program as number 0

Figure for question 12

Table 3 describes the purpose of three subroutines the program uses.

Figure for question 12 Figure for question 12
Figure for question 12

[2 marks]

Answer
Mark scheme for question 12.1
Figure for question 12

[2 marks]

Answer
Mark scheme for question 12.2
Figure for question 12

[1 mark]

Answer
Mark scheme for question 12.3

Explain the purpose of the second iteration structure in the program in Figure 16.

[1 mark]

Answer
Mark scheme for question 12.4

State the purpose of the program in Figure 16.

[1 mark]

Answer
Mark scheme for question 12.5

Table 4 shows a description of the getTile subroutine previously described in more detail in Table 3, on page 25.

Figure for question 12

Figure 18 and Figure 19 show example boards.

Figure for question 12

Write a C# program to:

maths symbol check that in the first row: o the second tile number is one more than the first tile number o the third tile number is one more than the second tile number

maths symbol display Yes when the row meets both conditions above

maths symbol display No when the row does not meet both conditions above.

For example:

maths symbol for the board in Figure 18, the program would display No

maths symbol for the board in Figure 19, the program would display Yes

You must use the getTile subroutine in your C# code.

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code accurately.

Figure for question 12

[4 marks]

Answer
Mark scheme for question 12.6

Table 5 describes the purpose of another two subroutines the program uses.

Figure for question 12

Table 6 shows a description of the move subroutine previously described in more detail in Table 3, on page 25.

Figure for question 12

Write a C# program to help the user solve the puzzle.

The program should:

maths symbol get the user to enter the row number of a tile to move

maths symbol get the user to enter the column number of a tile to move

maths symbol check if the tile in the position entered is next to the blank space o if it is, move that tile to the position of the blank space o if it is not, output Invalid move

maths symbol repeat these steps until the puzzle is solved.

You must use the subroutines in Table 5 and Table 6.

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid opposite contains vertical lines to help you indent your code accurately.

Figure for question 12

[6 marks]

Answer
Mark scheme for question 12.7

Question 13

Explain how the linear search algorithm works.

[3 marks]

Answer
Mark scheme for question 13

Question 14

State one property of local variables that is not true for all variables.

[1 mark]

Answer
Mark scheme for question 14.1

Using C#, write a subroutine to help a museum review the number of visitors in a month.

The subroutine must:

maths symbol have the identifier countDays

maths symbol have the number of days a museum was open in the last month as a parameter

maths symbol get the user to enter the number of visitors to the museum for each of those days

maths symbol count how many of those days the museum had more than 200 visitors

maths symbol return the count.

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code.

Figure for question 14 Figure for question 14

[6 marks]

Answer
Mark scheme for question 14.2

Question 15

A programmer is writing a game.

The game uses a row of cells represented as an array. Figure 20 shows an example.

Figure 20

Figure for question 15

Figure 21 describes how the game is to be played.

Figure for question 15

For example, using the array in Figure 20:

maths symbol the player starts in position 0

Figure for question 15

maths symbol if the player enters a 1, then they move to position 1

Figure for question 15

maths symbol if the player then enters a 2, Bad Move is displayed as position 3 contains an X

Figure for question 15

maths symbol the player then goes back to position 0

Figure for question 15

maths symbol if the player then enters a 2, they move to position 2

Figure for question 15

maths symbol if the player then enters a 2, they move to position 4

Figure for question 15

maths symbol if the player then enters a 1, they move to position 5

Figure for question 15

maths symbol if the player then enters a 2, the game finishes.

Figure for question 15

Figure 22 shows part of a C# program that will be used for the game.

Figure 22

int pos = 0; int lastPos = row.Length – 1; while (pos < lastPos)

pos is a variable that contains the player’s current position.

Extend the program from Figure 22 so that the game works as described in Figure 21, on page 37.

When writing your program you should assume:

maths symbol there is an array called row

maths symbol the number of X characters in row can vary

maths symbol the position of the X characters in row can vary

maths symbol the X characters have already been added to the array called row

maths symbol the row array can be of any length.

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code.

Figure for question 15 Figure for question 15

[8 marks]

Answer
Mark scheme for question 15

The paper as printed

June 2024 QP - Paper 1A AQA Computer Science GCSE

June 2024 QP - Paper 1B AQA Computer Science GCSE

June 2024 QP - Paper 1C AQA Computer Science GCSE

Spotted a mistake on this page?Report a problem