aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer ScienceTopic 6.3
Unit 6 · Programming · Topic 6.3

IB Computer Science — Programming constructs

Programming constructs

Exam technique guidePractice questions

Key concepts in Programming constructs

Key Idea: Every program is built from three control structures — sequence, selection and iteration — grouped into functions so each piece can be named, tested and reused.

Paper 1

  • Short definitions and a trace.
  • State, identify, outline — precise terms.

Paper 2

  • Write or correct Python for a scenario — your paper is the Python version, option B.
  • Construct, determine, suggest.

Both

  • Trace tables and justified choices earn method marks even when the final answer slips.

🔀 Selection

What gets asked

  • A chain of ELSE IF runs exactly one branch — the first that matches
  • Separate IF statements are each evaluated, so more than one can run
  • Test grade boundaries from the highest down, or every mark above 40 takes the first branch
  • A CASE statement needs a default, or an unmatched value is silently ignored
Important: A valid range needs AND — both bounds must hold. Testing for invalid needs OR — either bound breached is enough. 'mark < 0 AND mark > 100' can never be true, so nothing is ever rejected — and nothing reports it.

🔁 Iteration

LoopUse whenWatch for
FORThe count is known before the loop startsOff-by-one at the bounds
WHILEIt depends on what happens insideNothing in the body changes the condition
REPEAT-UNTILThe body must run at least onceTests AFTER, so it always runs once

Loop discipline

  • An infinite loop means nothing in the body changes what the condition tests
  • Move work that does not depend on the loop variable outside it
  • Nested loops multiply — which is why they become impossible at scale
  • Decide what is inside and what is outside before writing: an input inside asks twelve times; an output outside prints only the last value

🧱 Functions and modularity

TermMeaning
FunctionNamed block doing one task and returning a value
ProcedurePerforms an action and returns nothing
ParameterThe name in the definition
ArgumentThe value supplied at the call
By valuePasses a copy — the caller's variable is untouched
By referencePasses access — the caller's variable can be changed
Low coupling: a module depends only on another's published interface, so changes stay local. High cohesion: everything in a module serves one purpose. If a function's name needs the word 'and', it is doing too much.

📝 Exam-style questions

IB-style questionConstruct[5 marks]

Write a Python program that reads 10 marks, counts how many are 50 or above, and outputs that count together with the highest mark entered.

🔒 Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic →
IB-style questionExplain[3 marks]

A program validates a percentage with: IF mark < 0 AND mark > 100 THEN reject. Explain why no value is ever rejected, and give the correction.

🔒 Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic →

✅ Quick check

Cover the answers.

ELSE IF chain or separate IFs — which runs only one branch? The ELSE IF chain — the first match wins and the rest are skipped. Separate IFs are each evaluated.

Why test grade boundaries from the highest down? Otherwise every mark above 40 matches the first branch and no higher grade is ever awarded.

Parameter or argument — which is in the definition? The parameter. The argument is the value supplied at the call.

What does low coupling mean? A module depends only on another's published interface, so changing the body of one breaks nothing.

Where should an INPUT statement go in a loop that reads 12 values? Inside the loop. Outside it, the same value is reused twelve times.


Exam tips

  • Initialise outside the loop, read inside it, output outside it.
  • Valid range uses AND; invalid uses OR. Substitute a failing value to check.
  • '50 or above' is ≥, not >. Read the boundary wording twice.
  • A CASE statement needs a default branch.
  • A function returns a value; a procedure performs an action. Use the right word.
  • If a function's name needs 'and', split it in two.

What you'll learn in Topic 6.3

  • 6.3.1 Sequence
  • 6.3.2 Selection
  • 6.3.3 Loops
  • 6.3.4 Functions and modularity
Suggested study order: Read the notes for each sub-topic below → test yourself with flashcards → attempt practice questions → review exam technique.

Study resources — 6.3 Programming constructs

6.3.1

Sequence

Notes
6.3.2

Selection

Notes
6.3.3

Loops

Notes
6.3.4

Functions and modularity

Notes

Ready to study Programming constructs?

Get expert practice questions with instant AI feedback, and a study planner tailored to your IB Computer Science exam date.

Start studying free

Topic 6.3 Programming constructs forms a core part of Unit 6: Programming in IB Computer Science. Mastering these concepts will strengthen your understanding of connected topics across the syllabus and prepare you for exam questions that require analysis, evaluation, and real-world application.

Previous topic
6.2 Data structures
Next topic
6.4 Programming algorithms
All Computer Science topics
Exam technique

Ready to practice?

Get AI-graded practice questions, mock exams, flashcards, and a personalised study plan — all aligned to your IB syllabus.

Start Studying Free

No credit card required · No time limit