Computer Science: Paper 2: Application of Computational Thinking
Computer Science: Paper 2: Application of Computational Thinking
Computer Science: Paper 2: Application of Computational Thinking
Computer Science
Paper 2: Application of Computational Thinking
Instructions
• Use black ink or ball-point pen.
• Fill in the boxes at the top of this page with your name,
centre number and candidate number.
• Answer all questions.
• Answer the questions requiring a written answer in the spaces provided
– there may be more space than you need.
• Only one programming language must be used throughout the test.
• code using
Carry out practical tasks on the computer system and save new or amended
the name given with the appropriate file extension.
• Do not overwrite the original code and data files provided to you.
• must not use the internet during the test.
You
Information
• The total mark for this paper is 80.
• The marks for each question are shown in brackets
• The CODES
This paper covers Python, C# and Java.
• The invigilatorfolder in your user area includes all the code and data files you need.
• will tell you where to store your work.
Advice
• Read each question carefully before you start to answer it.
• Check yourwork
Save your regularly.
• answers and work if you have time at the end.
Turn over
*S54964A0112*
S54964A
©2017 Pearson Education Ltd.
1/1/1
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
2
*S54964A0212*
44 Pearson Edexcel International GCSE in Computer Science
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
(c) (i) Give a definition of a syntax error.
(1)
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
3
*S54964A0312*
Pearson Edexcel International GCSE in Computer Science 45
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
Turn over
2 A football club uses computer applications.
(a) The club collects this data about visitors:
• country of origin
• number of adults and children in each party.
4
*S54964A0412*
46 Pearson Edexcel International GCSE in Computer Science
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
(b) Each seat in the football stadium has a unique identifier. The identifier is made up
of two letters and two numbers, separated by a hyphen.
AB-45, NP-98, ab-46, nP-90 are valid seat identifiers.
Complete the table to show two additional validation tests and invalid data.
(4)
(c) The football club makes money selling tickets, food and other items. Attendance
at matches is also monitored.
At the end of each week, the data collected is processed.
Attendance is considered along with income (money coming in).
Open the file Q02c in the code editor.
Amend the code to complete the ‘If statement’ used to produce the outputs
described in the table. Do not add any further functionality.
Save your amended code as Q02cFINISHED with the correct file extension for the
programming language.
(4)
5
*S54964A0512*
Pearson Edexcel International GCSE in Computer Science 47
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019 Turn over
3 A holiday company has a website. They would like to publish the daily temperatures
in their most popular destinations.
(a) Describe one benefit of using subprograms.
(2)
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
(b) The holiday company needs to be able to convert temperatures between Celsius
and Fahrenheit.
Open the file Q03b in the code editor.
Answer these questions about the code.
(i) Identify the name of a built-in subprogram in the code.
(1)
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
(iv) Identify the name of a subprogram that does not use input parameters.
(1)
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . .
6
*S54964A0612*
48 Pearson Edexcel International GCSE in Computer Science
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
(c) The holiday company needs to assign numbers to their most popular destinations.
Cities.txt Numbered.txt
7
*S54964A0712*
Pearson Edexcel International GCSE in Computer Science
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
49
Turn over
4 A list of numbers is to be sorted using a bubble sort algorithm.
(a) Give a definition of the term ‘algorithm’.
(1)
. . . . . . . . . . ..................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . ..................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . .
28 7 26 21 34 18 16 9
(i) Complete the table to show how the list will have changed at the end of the
first pass.
(1)
. . . . . . . . . . ..................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . ..................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . .
8
*S54964A0812*
50 Pearson Edexcel International GCSE in Computer Science
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
(c) A bubble sort is only one type of sorting algorithm.
(i) Give one reason why a bubble sort is inefficient when sorting a large dataset.
(1)
. . . . . . . . . . ..................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . ..................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . .
(ii) State the position in a list that will always remain unchanged after the first
pass of any ascending order bubble sort.
(1)
. . . . . . . . . . ..................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . .
9
*S54964A0912*
Pearson Edexcel International GCSE in Computer Science 51
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
Turn over
5 Data, stored as numbers, is very easily processed using computer algorithms.
(a) Open the file Q05a in the code editor.
Complete the trace table to show the execution of the code.
You may not need to fill in all the rows in the table.
(5)
target rs rm r
10
*S54964A01012*
52 Pearson Edexcel International GCSE in Computer Science
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019
(b) Open the file named Q05b in the code editor.
Write a program to determine a discount based on an amount entered.
The program should:
• allow the user to input total spend
• display the output message based on the total spend entered.
11
*S54964A01112*
Pearson Edexcel International GCSE in Computer Science 53
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019 Turn over
6 Open the file named Q06 in the code editor.
In file Q06, the names and years of birth of artists are stored in a 2-dimensional data
structure.
Labels for their work need to be created by joining the first letter of their last name,
the first letter of their first name and their year of birth.
For example, a label for (‘Andy’, ‘Warhol’, 1928) would be ‘WA1928’.
Write a program to:
• process each artist to create a label
• store all the labels in the data structure named ‘theLabels’
• display the labels for all the artists
• find and display the name and year of birth of the youngest artist.
Your program should function correctly, even if ‘theArtists’ data structure has
more, fewer, or different artists.
You must use the data structures in file Q06.
Save your amended code as Q06FINISHED with the correct file extension for the
programming language.
12
*S54964A01212*
54 Pearson Edexcel International GCSE in Computer Science
Sample Assessment Materials - Issue 3 – May 2019 © Pearson Education Limited 2019