2210/22/O/N/24 question 3: worked solution (October/November 2024, paper 22)
Show as plain textHide plain text
Cambridge O Level Computer Science 2210 · 7.9 Writing and amending algorithms Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 8 of 8. Q106 2210/22/O/N/24 original Q3 Structured · 10 marks Worked solution (a) Draw one line from each symbol to its purpose. Rectangle with double side lines → subroutine [1] Rounded (oval) shape → terminator [1] Diamond → decision [1] Plain rectangle → process [1] The purpose "flow" is not used. (b) Draw the flowchart in this order, joined by arrows: START at the top and STOP at the end, both in terminator (rounded) shapes [1] Process boxes Total ← 0 and Count ← 1 before the loop. Inside the loop, Count ← Count + 1, then a decision diamond IS Count > 50 ? The No arrow goes back up to the prompt. [1] Input: an output box with a prompt, OUTPUT "Enter a value between 1 and 100", then an input box INPUT Number [1] Total set to 0 first, and a process box Total ← Total + Number inside the loop [1] The Yes arrow goes to an output box with a message, OUTPUT "The total is ", Total [1] All arrows, Yes/No labels and symbols correct [1] KEY IDEA A flowchart loop needs a set-up, a body, an increment and a decision diamond that sends the arrow back. TOTAL 10 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.