Computer Science · High School (9–10) · 3 courses, 30 worked problems, 30 practice questions
Before writing code, a good programmer plans. Decomposition breaks a problem into smaller parts, and abstraction keeps only the details that matter. The plan becomes an algorithm, written as a flowchart or in pseudocode. Standard methods solve common tasks: linear search, bubble sort, totalling, counting and finding the largest or smallest value. Validation checks that input is sensible, and verification checks that it was entered correctly. A trace table follows an algorithm step by step to find its output or its errors. Testing with normal, abnormal, extreme and boundary data shows whether it works.
Choose an answer, then check it. Each one shows a full explanation.
In which stage of the program development life cycle does a programmer test each module straight after writing it, correct it and test it again?
Which flowchart symbol is used for a step such as Speed > 70? that has a Yes exit and a No exit?
A bus app stores the route number and the time the bus reaches each stop. It does not store the colour of the bus or the name of the driver. What is this an example of?
Think of a smart heating controller as four groups: what comes in, what is worked out, what goes out and what is kept for later. Which item is kept for later (storage)?
A structure diagram for a quiz game has the top box Quiz game and three sub-systems below it. Set up splits into Load questions and Choose a level. Play splits into Ask a question, Check the answer and Update score. Finish splits into Show the score and Save best score. The diagram shows exactly this. How many boxes are on the lowest level?
The flowchart sets Value to and Count to . It then multiplies Value by and adds to Count, and repeats these two steps until the decision Value > 50? is Yes. It then outputs Count and Value. The diagram shows these steps. What is output?
A teacher finds this algorithm in an old program. Which sentence best states what it does? Below ← 0 FOR Index ← 1 TO 10 INPUT Number IF Number < 0 THEN Below ← Below + 1 ENDIF NEXT Index OUTPUT Below
The flowchart inputs Mark. The first decision is Mark >= 50?, and its No exit outputs "Fail". Its Yes exit leads to a second decision Mark >= 80?, whose Yes exit outputs "Merit" and whose No exit outputs "Pass". The diagram shows this. Which input gives the output "Pass"?
The flowchart that adds numbers until a is input (Total starts at ; each number that is not is added; then Total is output) must also count how many numbers were added. Which change does this correctly?
A program for a sports club is in the testing stage. The testers find that the club wanted junior members to pay half price, but nobody wrote this down. Which stage should the team go back to first?
All 30 practice questions on Algorithms and Problem-Solving →
Each one has a hint, the key idea and a full worked solution.