Aqa Gcse Computer Science Paper 1 May 2023 Question Paper 85251c Computational Thinking and Programming Skills Vbnet
Aqa Gcse Computer Science Paper 1 May 2023 Question Paper 85251c Computational Thinking and Programming Skills Vbnet
Surname
Forename(s)
Candidate signature
I declare this is my own work.
GCSE
COMPUTER SCIENCE
Paper 1 Computational thinking and programming skills – VB.NET
TOTAL
Advice
For the multiple-choice questions, completely fill in the lozenge alongside the appropriate answer.
CORRECT METHOD WRONG METHODS
If you want to change your answer you must cross out your original answer as shown.
If you wish to return to an answer previously crossed out, ring the answer you now wish to select as
shown.
*Jun2385251C01*
IB/G/Jun23/E10 8525/1C
2
Do not write
outside the
Answer all questions. box
Figure 1
x LEN(state)
A 1
B 5
C 10
D 12
*02*
IB/G/Jun23/8525/1C
3
Do not write
outside the
0 1 . 3 What is the result of concatenating the contents of the variables city and box
landmark in Figure 1?
y SUBSTRING(4, 7, landmark)
A Alca
B Atra
C land
D traz
Turn over ►
*03*
IB/G/Jun23/8525/1C
4
Do not write
outside the
Figure 1 has been included again below. box
Figure 1
z POSITION(landmark, 't')
A –1
B 3
C 4
D 5 6
*04*
IB/G/Jun23/8525/1C
5
Do not write
outside the
Turn over for the next question box
Turn over ►
*05*
IB/G/Jun23/8525/1C
6
Do not write
outside the
0 2 Figure 2 shows an algorithm that uses integer division which has been represented box
using pseudo-code.
• Line numbers are included but are not part of the algorithm.
Figure 2
1 again True
2 WHILE again = True
3 a USERINPUT
4 IF a > 0 THEN
5 counter 0
6 WHILE a > 0
7 a a DIV 3
8 counter counter + 1
9 ENDWHILE
10 ELSE
11 again False
12 ENDIF
13 OUTPUT a
14 ENDWHILE
Integer division is the number of times one integer divides into another, with the
remainder ignored.
For example:
• 14 DIV 5 evaluates to 2
• 25 DIV 3 evaluates to 8
A Line number 2
B Line number 4
C Line number 6
D Line number 11
*06*
IB/G/Jun23/8525/1C
7
Do not write
outside the
0 2 . 2 In the algorithm in Figure 2, what will be output when the user input is 10? box
A 0
B 1
C 2
D 4
0 2 . 3 In the algorithm in Figure 2, what is the largest possible value of the variable
counter when the user input is 36?
A 0
B 2
C 4
D 5
Turn over ►
*07*
IB/G/Jun23/8525/1C
8
Do not write
outside the
0 4 Figure 3 shows a program written in VB.NET that calculates the area of a rectangle or box
Figure 3
Sub Main()
Dim numOne, numTwo, numThree, answer As Integer
Console.Write("Enter width: ")
numOne = Console.ReadLine()
Console.Write("Enter length: ")
numTwo = Console.ReadLine()
Console.Write("Enter height, -1 to ignore:")
numThree = Console.ReadLine()
If numThree = -1 Then
Console.WriteLine($"Area {answer}")
Else
Console.WriteLine($"Volume {answer}")
End If
End Sub
5 6 –1
10 4 0
3 5 10
*08*
IB/G/Jun23/8525/1C
9
Do not write
outside the
0 4 . 2 Describe one way that the program in Figure 3 could be made more robust. box
[1 mark]
Turn over ►
*09*
IB/G/Jun23/8525/1C
10
Do not write
outside the
0 5 Figure 4 shows an algorithm presented as a flowchart. box
Figure 4
You may not need to use all the rows in the table.
[3 marks]
a b c
*10*
IB/G/Jun23/8525/1C
11
Do not write
outside the
Turn over for the next question box
Turn over ►
*11*
IB/G/Jun23/8525/1C
12
Do not write
outside the
0 6 Figure 5 shows an algorithm represented using pseudo-code. box
• If the username exists, the subroutine returns the password stored for that user.
• If the username does not exist, the subroutine returns an empty string.
Parts of the algorithm are missing and have been replaced with the labels to .
Figure 5
login False
REPEAT
username ''
WHILE username = ''
OUTPUT 'Enter username: '
username
ENDWHILE
password ''
WHILE password = ''
OUTPUT 'Enter password: '
password USERINPUT
ENDWHILE
storedPassword getPassword( )
IF storedPassword = THEN
OUTPUT ' '
ELSE
IF password = storedPassword THEN
login True
ELSE
OUTPUT 'Try again.'
ENDIF
ENDIF
UNTIL login = True
OUTPUT 'You are now logged in.'
*12*
IB/G/Jun23/8525/1C
13
Do not write
outside the
box
Figure 6
-1 OUTPUT 0
State the items from Figure 6 that should be written in place of the labels in the
algorithm in Figure 5.
Turn over ►
*13*
IB/G/Jun23/8525/1C
14
Do not write
outside the
0 7 A theme park charges £15 per person for a daily ticket. If there are six or more box
Write a VB.NET program to calculate the total charge for a group of people visiting the
theme park.
You should use meaningful variable name(s) and VB.NET syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.
[6 marks]
10
*14*
IB/G/Jun23/8525/1C
15
Do not write
outside the
0 8 Figure 7 shows a merge sort being carried out on a list. box
Figure 7
Turn over ►
*15*
IB/G/Jun23/8525/1C
16
Do not write
outside the
0 9 Figure 8 shows an algorithm, written using pseudo-code, that uses a RECORD data box
There are records for three films and these films are stored alphabetically in an array
called filmCollection.
The pseudo-code outputs the title of the newest of the three films.
Figure 8
RECORD Film
title : String
certificate : String
year : Integer
beingShown : Boolean
ENDRECORD
FOR i 0 TO
IF filmCollection[i].year > year THEN
year filmCollection[i].year
position i
ENDIF
ENDFOR
*16*
IB/G/Jun23/8525/1C
17
Do not write
outside the
0 9 . 1 How many different values can the field beingShown have? box
B 3
C 128
D 256
0 9 . 2 Which assignment statement changes the year the film Hulk was made to 2003?
B filmCollection[0].year 2003
C Film(year) 2003
D hulk(year) 2003
B LEN(filmCollection)
C LEN(filmCollection) – 1
D Position
0 9 . 4 Write a pseudo-code statement that updates the antMan record to show that the film
is currently being shown at the cinema.
[1 mark]
8
Turn over ►
*17*
IB/G/Jun23/8525/1C
18
Do not write
outside the
1 0 Figure 9 shows an algorithm, represented in pseudo-code, used to display students’ box
test scores. The algorithm does not work as expected and the teacher wants to find
the error.
The algorithm should display three test scores for each student:
• Natalie has results of 78, 81 and 72
• Alex has results of 27, 51 and 54
• Roshana has results of 52, 55 and 59.
• Line numbers are included but are not part of the algorithm.
Figure 9
You may not need to use all the rows in the table.
[5 marks]
*18*
IB/G/Jun23/8525/1C
19
Do not write
outside the
1 0 . 2 How could the error in the algorithm in Figure 9 be corrected? box
Turn over ►
*19*
IB/G/Jun23/8525/1C
20
Do not write
outside the
1 1 Figure 10 shows part of an algorithm that has been written in pseudo-code. box
• Line numbers are included but are not part of the algorithm.
Figure 10
1 validChoice False
2 REPEAT
3 difference –1
4 OUTPUT 'Enter a start year '
5 startYear USERINPUT
6 OUTPUT 'Enter an end year '
7 endYear USERINPUT
8 IF startYear ≥ endYear THEN
9 OUTPUT 'Start year must be before end year'
10 ELSE
11 IF startYear < 2000 THEN
12 OUTPUT 'Start year must be before 2000'
13 ELSE
14 validChoice True
15 ENDIF
16 ENDIF
17 UNTIL validChoice = True
18 difference endYear - startYear
19 OUTPUT difference
*20*
IB/G/Jun23/8525/1C
21
Do not write
outside the
1 1 . 1 Table 1 shows three tests used to check the algorithm in Figure 10. box
Complete the table to show what the values of the validChoice and
difference variables would be for the given test data.
[4 marks]
Table 1
startYear 1995
Normal
endYear 2010
startYear 2015
Erroneous
endYear 2000
startYear 2000
Boundary
endYear 2023
11
Turn over ►
*21*
IB/G/Jun23/8525/1C
22
Do not write
outside the
1 2 . 1 Figure 11 shows a binary search algorithm that has been programmed in VB.NET. box
Figure 11
Complete the trace table for the program in Figure 11 if the user input is wolf
You may not need to use all the rows in the table.
[4 marks]
wolf False 0 7 3
*22*
IB/G/Jun23/8525/1C
23
Do not write
outside the
1 2 . 2 Figure 12 shows a line of VB.NET code that creates an array of fruit names. box
Figure 12
Extend the program in Figure 12. Your answer must be written in VB.NET.
The program should get the user to enter a word and perform a linear search on the
array fruits to find if the word is in the array or not.
You must write your own linear search routine and not use any built-in search
function available in VB.NET.
You should use meaningful variable name(s) and VB.NET syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.
[7 marks]
Turn over ►
*23*
IB/G/Jun23/8525/1C
24
Do not write
outside the
box
*24*
IB/G/Jun23/8525/1C
25
Do not write
outside the
1 2 . 4 Figure 13 shows an algorithm, represented using pseudo-code, that should display box
• Line numbers are included but are not part of the algorithm.
Figure 13
1 SUBROUTINE diffCurrencies(currencies)
currencies ['baht', 'dollar', 'euro',
2 'koruna', 'lira', 'rand',
'rupee', 'yen']
3 RETURN currencies[x]
4 ENDSUBROUTINE
5
6 FOR i 8 TO 0 STEP 1
7 OUTPUT(diffCurrencies(i))
8 ENDFOR
Rewrite line 1 and line 6 from Figure 13 to make the algorithm work as intended.
[3 marks]
Line 1
Line 6
15
Turn over ►
*25*
IB/G/Jun23/8525/1C
26
Do not write
outside the
1 3 A programmer is writing a game. The game uses a 3 x 3 grid containing nine box
squares.
Figure 14
A B C
3 X
Figure 15 shows part of a VB.NET program that checks the grid reference entered by
a player.
The grid reference is valid if:
• there are exactly two characters
• the first character entered is A, B or C
• the second character entered is 1, 2 or 3.
Figure 15
Extend the program from Figure 15 so it completes the other checks needed to make
sure a valid grid reference is entered.
You should use meaningful variable name(s) and VB.NET syntax in your answer.
The answer grid contains vertical lines to help you indent your code.
[6 marks]
*26*
IB/G/Jun23/8525/1C
27
Do not write
outside the
box
Dim check As Integer = False
square = Console.ReadLine()
square = square.ToUpper()
End While
End While
Turn over ►
*27*
IB/G/Jun23/8525/1C
28
Do not write
outside the
1 4 50 students have voted for the music genre they like best. box
The programmer has used a two-dimensional array called results to store the
genre and the number of votes for each genre.
Parts of the algorithm are missing and have been replaced with the labels to .
Figure 16
*28*
IB/G/Jun23/8525/1C
29
Do not write
outside the
State what should be written in place of the labels to in the algorithm in box
Figure 16.
[3 marks]
Turn over ►
*29*
IB/G/Jun23/8525/1C
30
Do not write
outside the
1 5 A group of people have a meal in a restaurant. Instead of one person paying for the box
whole meal, each person will pay for what they eat.
Write a VB.NET program that asks each person in the group how much they are
paying towards the meal and works out when the bill is fully paid. Each person can
pay a different amount.
You should use meaningful variable name(s) and VB.NET syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.
[8 marks]
*30*
IB/G/Jun23/8525/1C
31
Do not write
outside the
box
Turn over ►
*31*
IB/G/Jun23/8525/1C
32
Do not write
outside the
1 6 Question 16 is about a dice game played against a computer. box
The aim of the game is to get as close to a score of 21 as you can, without going over
21. If your score goes over 21 then you lose.
• if the final score is 21, output a message to say the player has won
• if the final score is greater than 21, output a message to say the player has lost
• if the final score is less than 21, the program generates a random number between
15 and 21 inclusive:
o if this random number is greater than the player’s final score, output a message
to say the player has lost
o otherwise, output a message to say the player has won.
Figure 17 shows the output of a program that plays this dice game.
Figure 17
Roll 1: 1
Roll 2: 4
Current score: 5
Would you like to roll again? yes
Roll 1: 1
Roll 2: 6
Current score: 12
Would you like to roll again? yes
Roll 1: 1
Roll 2: 2
Current score: 15
Would you like to roll again? yes
Roll 1: 6
Roll 2: 1
Current score: 22
You lost!
The first line has been written for you in the answer grid.
*32*
IB/G/Jun23/8525/1C
33
Do not write
outside the
The dice rolls are carried out by the program generating random numbers between 1 box
and 6. You will need to use the VB.NET function r.Next(a, b) which generates a
random integer in the range a to b starting at a but finishing one before b.
You should use meaningful variable name(s) and VB.NET syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.
[11 marks]
Dim r As Random = New Random()
Turn over ►
*33*
IB/G/Jun23/8525/1C
34
Do not write
outside the
box
11
END OF QUESTIONS
*34*
IB/G/Jun23/8525/1C
35
Do not write
outside the
There are no questions printed on this page box
*35*
IB/G/Jun23/8525/1C
36
Do not write
outside the
box
Question Additional page, if required.
number Write the question numbers in the left-hand margin.
*36*
IB/G/Jun23/8525/1C
37
Do not write
outside the
Question Additional page, if required. box
*37*
IB/G/Jun23/8525/1C
38
Do not write
outside the
box
Question Additional page, if required.
number Write the question numbers in the left-hand margin.
*38*
IB/G/Jun23/8525/1C
39
Do not write
outside the
Question Additional page, if required. box
*39*
IB/G/Jun23/8525/1C
40
Do not write
outside the
There are no questions printed on this page box
Copyright information
For confidentiality purposes, all acknowledgements of third-party copyright material are published in a separate booklet. This booklet is published after
each live examination series and is available for free download from www.aqa.org.uk.
Permission to reproduce all copyright material has been applied for. In some cases, efforts to contact copyright-holders may have been unsuccessful
and AQA will be happy to rectify any omissions of acknowledgements. If you have any queries please contact the Copyright Team.
*236G8525/1C*
*40*
IB/G/Jun23/8525/1C