9618/21/O/N/21 question 1: worked solution (October/November 2021, paper 21)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 9.1 Computational Thinking Skills Worked solution from the Algorithm Design and Problem-solving Paper 2 Problem-solving and Programming booklet, Part 1 of 2. Q1 9618/21/O/N/21 original Q1 Structured · 14 marks Worked solution (a)(i) Write: the program follows the rules (grammar) of the programming language, so it can be translated and run [1] An example also scores, such as no mis-spelt keywords or all brackets match. (a)(ii) Give the type of error and describe it. Either answer scores: Type: logic error [1] Description: the algorithm is wrong, so the program runs but does not give the expected output (for example the wrong operator or loop count) [1] Or: run-time error (the program does an illegal operation such as divide by zero, or crashes or loops forever) with its description. (b) Choose the type that suits the data. One mark per row: Use of variable Data type The average mark in a class of 40 students REAL An email address STRING The number of students in the class INTEGER To indicate whether an email has been read BOOLEAN Average mark: REAL (it can have a decimal part) [1] Email address: STRING [1] Number of students: INTEGER [1] Email read or not: BOOLEAN (TRUE or FALSE) [1] (c)(i) Tick Essential for the things a customer needs to choose and book a flight: Information Essential Not essential Departure time ✓ Flight number ✓ Departure airport ✓ Aircraft type ✓ Ticket price ✓ Number of seats in aircraft ✓ Any two rows correct [1] Four rows correct [1] All six rows correct [1] (c)(ii) Technique: abstraction (keeping only the important details and leaving out the rest) [1] Benefit: the solution is simpler, so it is easier and quicker to design and build (or it is made to fit what the user needs) [1] (c)(iii) Write any two of these, one mark each: Destination (arrival) airport [1] Date of the flight [1] Also accepted: arrival time or flight duration, seat number, seat availability. KEY IDEA Abstraction removes the details that are not needed; syntax errors break language rules, logic errors give wrong results. TOTAL 14 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Mr Saem. Tap the picture to open it on YouTube.