IB Computer Science HL · Year 2 · Lesson 4

Sequence and selection

Programming constructs control the order, branching and repetition of instructions and support modular solutions.

Paper 250 minutesB2.3.1 · B2.3.2
Today’s targets

What you need to be able to do

2 / 8
  • ConstructPrograms that implement the correct sequence of code instructions to meet program objectives
  • ConstructPrograms utilizing appropriate selection structures
B2.3.1B2.3.2
Paper 2 lensMatch the depth of every response to the command term. Previously learned content can move quickly, but retrieval must still be accurate.
Retrieve

Rapid Recall Deck

3 / 8

Say the answer aloud before flipping. Mark secure knowledge quickly and spend time on the gaps.

  • Why does the sequence of instructions matter in a program?: Changing instruction order can change the program state, output, or whether later instructions work correctly.
  • What is the purpose of a selection structure?: It chooses which block of code executes based on whether a condition is true or false.
  • Which selection keywords are required in Java and Python?: Both use if and else; Java uses else if, while Python uses elif.
  • What do AND, OR, and NOT do in a condition?: AND requires both conditions to be true; OR requires at least one to be true; NOT reverses a Boolean value.
  • Which relational operators are commonly used to control selection?: <, <=, >, >=, ==, and !=.
  • What control-flow problems can poor program structure cause?: Examples include infinite loops, deadlock, and incorrect output.
B2.3.1 + B2.3.2 · Learn

Core knowledge and application

4 / 8
B2.3.1Construct

Programs that implement the correct sequence of code instructions to meet program objectives

Programming constructs control the order, branching and repetition of instructions and support modular solutions.

Exam moveProduce the required code, diagram, query, model or representation accurately.
Required detail 1The impact of instruction order on program functionality
Required detail 2Ways to avoid errors, such as infinite loops, deadlock, incorrect output
Assessment boundaryPaper 2

Explain it without notes

Construct: Programs that implement the correct sequence of code instructions to meet program objectives in the context of a program that validates and processes course choices.

  • The impact of instruction order on program functionality
  • Ways to avoid errors, such as infinite loops, deadlock, incorrect output
B2.3.2Construct

Programs utilizing appropriate selection structures

Programming constructs control the order, branching and repetition of instructions and support modular solutions.

Exam moveProduce the required code, diagram, query, model or representation accurately.
Required detail 1Must include: if, else, else if (Java), elif (Python), to execute different code blocks based on specified conditions
Required detail 2Selection structures with or without Boolean operators (AND, OR, NOT) and/or relational operators (<, <=, >, >=, ==, !=) to control program flow effectively
Assessment boundaryPaper 2

Explain it without notes

Construct: Programs utilizing appropriate selection structures in the context of a program that validates and processes course choices.

  • Must include: if, else, else if (Java), elif (Python), to execute different code blocks based on specified conditions
  • Selection structures with or without Boolean operators (AND, OR, NOT) and/or relational operators (<, <=, >, >=, ==, !=) to control program flow effectively
Trace / construct

Programming checkpoint

5 / 8
age = 17
has_id = True
if age >= 16 and has_id:
    print("Allowed")
else:
    print("Check requirements")
Before you run itTrace the code by hand. Identify state changes, branch/loop behaviour, and the final result.

Modify it

Change one condition, input or operation so the program solves a slightly different problem. Predict the effect before editing.

Apply

Transfer to a new scenario

6 / 8
ScenarioA program that validates and processes course choices needs a design or technical decision related to today’s topic. Explain what matters and why.
  • The impact of instruction order on program functionality
  • Ways to avoid errors, such as infinite loops, deadlock, incorrect output
  • Must include: if, else, else if (Java), elif (Python), to execute different code blocks based on specified conditions
  • Selection structures with or without Boolean operators (AND, OR, NOT) and/or relational operators (<, <=, >, >=, ==, !=) to control program flow effectively
Exam lens

Paper 2 practice

7 / 8
Build the response before checking notesUse precise terminology and match the required depth.
  1. Construct: Programs that implement the correct sequence of code instructions to meet program objectives in the context of a program that validates and processes course choices.
  2. Construct: Programs utilizing appropriate selection structures in the context of a program that validates and processes course choices.
Self-checkAnswer the exact command term. For explain, include mechanism/reason; for compare, pair criteria; for discuss/evaluate/justify, build supported reasoning and a conclusion.
Homework

Finish the learning cycle

8 / 8

IA — main task

Refine Criteria A/B/C. Use today’s lesson to make the problem specification, decomposition, algorithms or testing plan more precise where relevant.

Syllabus — 10–15 min

Repeat the recall deck and complete the lesson response prompt without model support.