Question 1

Edexcel Computer Science June 2025 Paper 2GCSE9 marks

On the specification

6.1 Develop code6.3 Data types and structures6.5 Operators
Question text

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) 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)