Question 2
Edexcel Computer Science June 2025 Paper 2GCSE10 marks
On the specification
- 6.2 Program constructs6.5 Operators6.6 Subprograms
Question text
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)