9618/22/O/N/22 question 1: worked solution (October/November 2022, paper 22)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 12.3 Program Testing and Maintenance Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3. Q40 9618/22/O/N/22 original Q1 Structured · 11 marks Worked solution (a)(i) Write any two of these: Part of the algorithm is repeated or reused in several places [1] Part of the algorithm does one specific task [1] It makes the program simpler, or an existing subroutine can be used. Testing, debugging and maintenance also become easier. (a)(ii) Term: parameters [1] Use: they pass values (arguments) into the procedure when it is called. [1] (b) Test stage: beta testing [1] Description (any three of these): It is done by a small group of potential users [1] The users check that the software works as required in the real world and has no errors [1] The users report problems and suggest improvements [1] The problems and suggestions are dealt with before the program is sold. (Only three of these four points score.) (c) Work out each expression using the example values: the month of 23/04/2004 is 4, so MID("ABCDEF", 4, 1) is the 4th letter. 29 ÷ 6 = 4.83, so INT gives 4. Count >= 29 is TRUE but DAY is 23, so DAY > 23 is FALSE, and TRUE AND FALSE is FALSE. Expression Evaluation MID(CharList, MONTH(FlagDay), 1) "D" INT(Count / LENGTH(CharList)) 4 (Count >= 29) AND (DAY(FlagDay) > 23) FALSE Row 1 correct [1] Row 2 correct [1] Row 3 correct [1] KEY IDEA Evaluate built-in functions one at a time, then combine the results with the AND or OR. TOTAL 11 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Audere Prep. Tap the picture to open it on YouTube.