Tuesday 20 May 2025
Afternoon (Time: 2 hours)
Paper
reference 1CP2/02
Computer Science
PAPER 2: Application of Computational Thinking
You must have:
• a computer workstation with appropriate programming language code editing software
and tools, including an IDE that you are familiar with that shows line numbers
• a ‘STUDENT CODING’ folder containing code and data files
• printed and electronic copies of the Programming Language Subset (PLS) document
(enclosed).
Instructions
•• Answer all questions on your computer.
Save the new or amended code in the ‘COMPLETED CODING’ folder using the
name given in the question.
•• Do not overwrite the original code and data files provided to you.
You must not use the internet at any time during the examination.
Information
•• The total mark for this paper is 75.
The marks for each question are shown in brackets
– use this as a guide as to how much time to spend on each question.
• The ‘STUDENT CODING’ folder in your user area includes all the code and data files
you need.
Advice
•• Read each question carefully before you start to answer it.
Save your work regularly.
• Check your answers and work if you have time at the end.
Turn over
P78600A
©2025 Pearson Education Ltd.
Y:1/1/1/1/1/1/1/1
*P78600A* for more: tyrionpapers.com
, Answer ALL questions.
Suggested time: 10 minutes
1 A program calculates a discount based on the number of two-course meals,
three‑course meals and drinks ordered by the user.
When the total number of meals exceeds eight, a 15% discount is applied.
When the number of three-course meals exceeds four, a 10% discount is applied.
When the number of two-course meals exceeds two, a 5% discount is applied.
Only one discount can be applied.
When the number of drinks does not match the total number of meals, an error
message is displayed. The total must not be calculated or displayed.
Open file Q01.py
Amend the code to:
• fix the syntax error on original line 4
cost2Courses = 15.00 Cost of meals
• fix the syntax error on original line 6
cost Drinks = 2.00
• fix the syntax error on original line 10
0 = numDrinks
• fix the TypeError on original line 28
total = "num2Courses" * cost2Courses
• fix the NameError on original line 29
total = total + num3Courses * cost33Courses
• fix the NameError on original line 38
total = 0.95 * tatol
• fix the logic error on original line 33
if (num2Courses - num3Courses > 8): # Get 15% discount
• fix the logic error on original line 34
total = 0.85 + total
• fix the logic error on original line 40
print ("Total is:", total)
2 P78600A
for more: tyrionpapers.com
, Do not change the functionality of the given lines of code.
Do not add any additional functionality.
Save your amended code file as Q01FINISHED.py
(Total for Question 1 = 9 marks)
P78600A for more: tyrionpapers.com
3
Turn over
, Suggested time: 10 minutes
2 A program is required to simulate the countdown to a rocket launch.
The user inputs a number between 1 and 10.
The program counts down from that number.
The wait time between each count is 1.5 seconds and is stored in the program code.
Here is the output of a functioning program, when the user enters the number 3
What is the countdown? 3
3
2
1
Ignition - lift off!
Open file Q02.py
Amend the code to:
• import the time library
• create a variable named countDown and set it to 0
• take the input from the user and convert it to an integer
• ensure the number inputted is valid by using two relational operators and one
logical operator
• ensure that the loop stops when it reaches 0
• display countDown for the user
• call a function in the time library to pause the program for the wait time
• reduce countDown by 1
• display “Ignition – lift off!” for the user.
Do not add any additional functionality.
Save your amended code as Q02FINISHED.py
(Total for Question 2 = 10 marks)
4 P78600A
for more: tyrionpapers.com