Question 6
Edexcel Computer Science June 2025 Paper 2GCSE15 marks
On the specification
- 6.1 Develop code6.2 Program constructs6.4 Input and output6.6 Subprograms
Question text
6 A set of records is stored in a two-dimensional array. The fields in each record are a key and a signal reading. A valid key: • has a minimum length of three • is a group of letters and digits • ends with a valid check digit. The table shows how to calculate the check digit for any key. Key Sum the digits only in Check digit = right-most the key digit of sum A2B3C5 2 + 3 = 5 5 A7B30 7 + 3 = 10 0 A11 1 1 A274B3 2 + 7 + 4 = 13 3 A valid signal reading must be a real number: • greater than or equal to 1.0 • less than or equal to 5.0 Some of the records have errors. Eight records have invalid keys. Four records have invalid signals. Open file Q06.py Write a program to meet these requirements: • find and display each invalid record, including the key and the signal • inform the user if a record has an invalid key (no reason required) • inform the user if a record has an invalid signal (no reason required) • work even if the number of records is changed • include at least one user-devised subprogram. Use comments, white space and layout to make the program easier to read and understand. Do not add any additional functionality. Save your amended code as Q06FINISHED.py (Total for Question 6 = 15 marks)