Learn in your language
Skip to content
A Level · Cambridge (CIE) · 9626

Algorithms and flowcharts

Learn the core concepts and decision-making in Cambridge 9626 Topic 4, then practise recall, application and transfer with fictional scenarios.

Cambridge International AS & A Level Information Technology 9626 · 4
Exam scope and assessment notes

This is original StudyForA teaching and fictional practice based on Cambridge syllabus outcomes, not copied syllabus text, an official question, a required software brand or a Cambridge mark scheme. Practical software tasks here are planning and reasoning exercises; StudyForA does not inspect files created in spreadsheet, database, graphics, audio/video or animation software, simulate the practical exam environment, award official marks or predict a grade. Follow the software and file-format requirements issued by your centre for your exam year.

Before you begin

  • Check whether your route is AS Level (Topics 1–11) or full A Level (Topics 1–21).

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

Before Topic 4: algorithms and flowcharts

What you will learn

  • Write and edit algorithms using input/output, arithmetic and comparison operators
  • Use selection, CASE, loops, nested loops and procedures/subroutines
  • Draw and interpret flowcharts using start/stop, input/output, process, decision, connector, subroutine and flowline symbols
  • Trace algorithms and identify logic, boundary and loop errors

Make the control flow explicit

An algorithm is a finite, ordered method for solving a problem. Define inputs, outputs and conditions before writing steps. IF/ELSE handles a condition; CASE selects among several alternatives; FOR suits a known repetition count; WHILE checks before each pass; REPEAT…UNTIL checks after a pass. A nested loop repeats one process inside another. Procedures give a named, reusable subtask.

Trace before trusting

A flowchart expresses the same logic with standard symbols: terminators, input/output, process, decisions, connectors, subroutines and arrows. Dry-run with ordinary, boundary and invalid inputs. Check initial values, update steps, branch coverage and termination. An off-by-one loop may omit the first or last value; a missing update can make a loop never end.

Sources for this lesson

Pause and explain

Which approach best demonstrates secure, reliable IT practice in algorithms and flowcharts?

Put the idea to work

Worked example

Write pseudocode to total five valid quiz marks from 0 to 20 and output the mean.

Show the worked solution
  1. Set total to zero before the loop.
  2. Read five marks, validate each, and add them to total.
  3. Divide by five and output the mean.

Answer Total ← 0; FOR Count ← 1 TO 5; INPUT Mark; WHILE Mark < 0 OR Mark > 20: INPUT Mark; Total ← Total + Mark; NEXT Count; Mean ← Total / 5; OUTPUT Mean. In a real solution, the re-entry prompt should explain the allowed range and all variables should be initialised.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

A program should print every even number from 2 through 12. Give the loop logic and one boundary test.

Give me a hint

A FOR loop can use a step value; check that the final value is included.

Compare my reasoning
  1. Start the loop at 2.
  2. Increase by 2 each iteration.
  3. Stop after processing 12 and test the last output.

FOR N ← 2 TO 12 STEP 2; OUTPUT N; NEXT N. The output is 2, 4, 6, 8, 10, 12. A boundary test confirms that 12 is included and 14 is not. A loop from 1 or a step of 1 would not meet the requirement.

Look for these in your work

  • Correct start/end/step
  • Produces the required sequence
  • Checks the boundary
2 · Independent

A delivery algorithm adds each order value but never changes the order counter. Explain the fault and repair.

Give me a hint

Trace what must change for the loop condition to become false.

Compare my reasoning
  1. Identify the loop condition and counter initial value.
  2. Find whether the counter changes on every pass.
  3. Add an increment or use a bounded FOR loop.

If the counter is part of the loop condition and is never incremented, the condition may remain true forever. Increment it once after each order is processed, or use a FOR loop over a known order count. Test zero, one and the maximum expected orders.

Look for these in your work

  • Explains non-termination
  • Repairs the control flow
  • Names useful tests
3 · Transfer

A traffic light cycles through green, amber and red, but emergency mode must immediately show red. Which construct clarifies the logic?

Give me a hint

There are several named states plus a priority override.

Compare my reasoning
  1. Check emergency mode before normal phase handling.
  2. Use CASE for the normal light state.
  3. Ensure each state has an explicit next state.

An IF condition should give emergency mode priority and set red immediately. Otherwise, a CASE statement can handle the normal green, amber and red sequence. The controller should define how emergency mode exits and test every state transition so the override cannot leave an undefined state.

Look for these in your work

  • Prioritises the safety condition
  • Uses selection appropriately
  • Accounts for state transitions

Common mistakes

  • Failing to initialise an accumulator
  • Choosing a loop whose condition never changes
  • Confusing a flowchart decision with a process box
Recall without your notes

What can you explain now?

A program should print every even number from 2 through 12. Give the loop logic and one boundary test.

Compare with the explanation

FOR N ← 2 TO 12 STEP 2; OUTPUT N; NEXT N. The output is 2, 4, 6, 8, 10, 12. A boundary test confirms that 12 is included and 14 is not. A loop from 1 or a step of 1 would not meet the requirement.

A FOR loop can use a step value; check that the final value is included.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

When is REPEAT…UNTIL preferable to WHILE…ENDWHILE?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Information Technology

Course scope and assessment

All 21 top-level topics are mapped to original lessons and Guided, Independent and Transfer practice: AS Topics 1–11 and A Level Topics 12–21. Topic objectives include the examinable subtopic families, while practical software work is represented by reasoning tasks rather than an interactive office/design application. Five practical/assessment limitations remain explicit: authentic application performance and file inspection, timed full-paper simulations for Papers 2 and 4, annual technical-update review, and official marking. For the 2028–2030 syllabus, exams are available in June and November and also in March in India. Entry options and administrative zones vary; confirm the exam year, series and centre availability with the exams officer.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.