Skip to main content
A-LevelComputer ScienceProgramming ConceptsMay/June 2022Paper 2 Q821 Marks

A program allows a user to save passwords used to login to websites. A stored password is inserted automatically when the user logs into the corresponding website. A student is developing a program to generate a password. The password will be of a fixed format, consisting of three groups of four alphanumeric characters. The groups are separated by the hyphen character '-'. An example of a password is: "FxAf-3haV-Tq49" A global 2D array Secret of type STRING stores the passwords together with the website domain name where they are used. Secret contains 1000 elements organised as 500 rows by 2 columns. Unused elements contain the empty string (""). These may occur anywhere in the array. An example of a part of the array is: Array element | Value ---|--- Secret [27, 1] | "www.thiswebsite.com" Secret [27, 2] | "............." Secret [28, 1] | "www.thatwebsite.com" Secret [28, 2] | "............." Note: • For security, passwords are stored in an encrypted form, shown as "............." in the example. • The passwords cannot be used without being decrypted. • Assume that the encrypted form of a password will not be an empty string. The programmer has started to define program modules as follows: Module | Description ---|--- RandomChar() | • Generates a single random character from within one of the following ranges: | ◦ 'a' to 'z' | ◦ 'A' to 'Z' | ◦ '0' to '9' | • Returns the character Encrypt() | • Takes a password as a parameter of type string | • Returns the encrypted form of the password as a string Decrypt() | • Takes an encrypted password as a parameter of type string | • Returns the decrypted form of the password as a string For reference, relevant ASCII values are as follows: Character range | ASCII range ---|--- 'a' to 'z' | 97 to 122 'A' to 'Z' | 65 to 90 '0' to '9' | 48 to 57

📋 Examiner Report & Trap Analysis

Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...

🎯 Mark Scheme Breakdown

Award 1 mark for identifying the correct principle. Award 1 mark for showing clear working. Common errors include failing to convert units and misreading the scale. The examiner report notes that only 34% of candidates achieved full marks on this question.

🔒

Unlock the Examiner's Analysis

Sign up for free to reveal the full examiner report, trap analysis, and mark scheme breakdown for this question.

Sign Up Free to Unlock →

Join thousands of Cambridge students already using Oracle Prep

About This A-Level Computer Science Question

Topic

This structured question tests Programming Concepts in A-Level Computer Science (syllabus code 9618). It is worth 21 marks.

Source

This question appeared in the Cambridge A-Level Computer Science May/June 2022 examination, Paper 2 Variant 1.

Practice on Oracle Prep

Oracle Prep provides AI-powered practice for all Cambridge O-Level and A-Level subjects. Our platform includes topic predictions with 87.7% accuracy, AI essay grading, and a comprehensive question bank spanning 25 years of past papers across 29 subjects.

Related Computer Science Questions

© 2026 Oracle Prep — The AI-Powered Cambridge Exam Engine