▲ Camp45
Sign inTry free for 7 days

Computer Science · Theme B: Computational thinking and problem-solving

B2.3 — Programming constructs

Computer Science · SL / HL · syllabus-mapped notes

  1. CS_B2.3.1

    Correct sequence of instructions

    How instruction order affects output, and avoiding infinite loops, deadlock and wrong output.

    Full note — free

    Sequence is the order in which instructions run. You must be able to construct programs whose steps are in the correct order to meet the objective. Impact of instruction order A program executes top to bottom, so a value must be set before it is used. Reordering steps can change or break the result. e.g. total = 0 total = total + 5 # correct: total defined first print(total) # 5 # swapping lines 1 and 2 would cause an error Errors to avoid Infinite loop : a loop whose condition never becomes false, so it never ends (forgetting to update the counter). Deadlock : two tasks each wait for the other, so neither proceeds. Incorrect output : logically valid code that produces the wrong answer, often from mis-ordered steps. In every loop, make sure the value in the condition is actually changed inside the loop, or it will run forever.

  2. CS_B2.3.2

    Selection structures

    if, else, else if / elif with Boolean (AND, OR, NOT) and relational operators.

    Selection runs different code depending on a condition. You must be able to construct programs using selection structures. Keywords (must include) Python : if, elif, else. Java : if, else if, else. Each guards a block that runs only when its condition is true. Relational …

    Read the full note free for 7 days →

  3. CS_B2.3.3

    Looping structures

    Counted and conditional loops, and choosing the right one.

    Loops repeat a block of code. You must be able to construct programs that use looping structures, choosing the appropriate type. Counted loop Repeats a known number of times. Use when you know how many iterations are needed. e.g. for i in range(5): # runs …

    Read the full note free for 7 days →

  4. CS_B2.3.4

    Functions and modularization

    Reusable functions, modular design, scope and the benefits of both.

    You must be able to construct functions and apply modularization . Functions A named, reusable block of code that takes inputs (parameters) and can return a result. Call it many times with different inputs instead of repeating code. e.g. def area(w, h): # reusable block …

    Read the full note free for 7 days →

This topic has 4 full notes in Camp45 — with flashcards, a quiz and Sherpa, the AI tutor, on every one. Try 7 days free →
Sherpa, your Camp45 mountain guide
Hi, I'm Sherpa — your IB mountain guide.
I take you from your material to the syllabus summit. Ask me anything, hand me your essay or your notes — I'll turn it into your system.
💬
Ask me anything
Any of the 26 subjects — I answer from the syllabus.
📝
Essay check
I grade your draft and flag what reads like AI.
📄
Upload your notes
Handout or textbook page → your own syllabus map.
🃏
Flashcards & decks
I turn any topic into a deck you can drill.
3 of 3 free questions — no sign-up.
📝 Check your essay before you hand it in
Sherpa grades it against the IB criteria and flags passages that read like AI — so you can fix them first.

Full notes + a tutor. Every subject, one payment.

Camp45 turns the syllabus into notes that give you exactly what the exam asks — so you study smarter, not harder.

Monthly

€19/mo

All the notes, cancel anytime

Go monthly
Most popular

Full-year access

€149

Every subject, paid once

Get full-year access

Both diploma years

€229

Both years, paid once

Get both years

Syllabus-exact notes

Every understanding statement written out in full — nothing more than the exam asks, nothing left out.

A tutor that answers from the syllabus

Ask anything and it answers from the exact points you are studying.

Every subject, one payment

All 26 IB subjects, SL & HL, covered by a single payment — no per-subject fees.

No credit card. Try the free Biology preview before you commit.