Question 4
Edexcel Computer Science June 2025 Paper 2GCSE11 marks
On the specification
- 6.2 Program constructs6.4 Input and output
Question text
4 A program is required to calculate the values in a multiplication square. Here is an example of a multiplication square. × 1 2 3 4 5 11 2 3 4 5 2 × 5 = 10 22 4 6 8 10 33 6 9 12 15 44 8 12 16 20 55 10 15 20 25 The number 10, at the intersection of row 2 and column 5, is the result of 2 × 5 The user enters a number for the sides of the square into the program. The program has these requirements: • calculate the values for the multiplication square • write the values to a new file • separate values with commas • do not include the row and column labels. Here are the contents of the output file, when the user enters the number 5 1,2,3,4,5 2,4,6,8,10 3,6,9,12,15 4,8,12,16,20 5,10,15,20,25 The program is partially complete. Open file Q04.py Amend the code to meet the requirements. Use the constants, variables and existing code provided. Do not add any additional functionality. Save your amended code as Q04FINISHED.py (Total for Question 4 = 11 marks)