ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions

Higher Computing Science 2023 Question 10

8 marks · Software analysis

State one boundary for this program. Using a recognised design technique, design an algorithm that would create the updated password and store it in a file. When implemented, the program will be modular. Describe two benefits of implementing modular code. A check digit is the number at the end of a series of characters that can confirm that something is correct. A program is to be written to add a check digit to a user’s password. The password is input and then the program totals the ASCII values of all the characters, divides the total by 11 and calculates the remainder. This remainder is then attached to the original password as a check digit. For example, for the password ‘Fox’: Character ASCII Value F 70 o 111 x 120 Total 301 301/11 = 27 remainder 4 The updated password is ‘Fox4’.

Marking scheme

Award 1 mark for each bullet. Maximum 1 mark. • Only allows characters with ASCII codes. • Password has a minimum of one character Award 1 mark for each bullet. • Initialise and update total • Loop for length of password and get ASCII value of current character • Use of mod 11 to get remainder • Concatenate remainder to original password • Open/write to/close file Award 1 mark for each bullet. Maximum 2 marks. • Facilitates module libraries which allows the reuse of code • Each part of the solution can be tested independently. • Errors are easier to locate. • Different programmers can code different modules (independently). • Variables only in memory during execution of subroutine. • Limits accessibility of local variables.

Previous question: Higher Computing Science 2023 Question 9

Next question: Higher Computing Science 2023 Question 11