9618/22/M/J/23 question 1: worked solution (May/June 2023, paper 22)

Show as plain text

Cambridge AS Level Computer Science 9618 · 11.1 Programming Basics Worked solution from the Programming Paper 2 Problem-solving and Programming booklet, Part 1 of 3. Q10 9618/22/M/J/23 original Q1 Structured · 10 marks Worked solution (a)(i) Use constants [1] (a)(ii) Any three of these: The postal cost is entered once only [1] It avoids input errors and different values for the same cost in different places [1] When rates change, the constant is changed once only , so the program is easier to maintain [1] The program is easier to understand because the constant has a meaningful name (also scores, but only three marks are available). (b) Any three of these: Indentation [1] Comments [1] Capital letters for keywords [1] Sensible, meaningful variable names or white space also score, but only three marks are available. (c) ValidAddress: BOOLEAN [1] ItemPostalCost: REAL [1] ItemStatus: STRING [1] KEY IDEA Use named constants for fixed values so they are set once, and use clear layout and names to make code readable. TOTAL 10 marks Official mark scheme VIDEO ▶ Starts at Q1 (0:18) Starts at Q1 (0:18) · by Pseudocode Pro. Tap the picture to open it on YouTube.