← IGCSE Computer Science 0478 — 8.1b Sequence, Selection and Iteration

IGCSE Computer Science 0478 — 8.1b Sequence, Selection and Iteration Hangman

Years 10–11 · IGCSE · 36 key terms.

Theme
Words

Every word, shuffled.

Players

The three ways to control what a program does next. See the whole journey →

Want your own words? Free Hangman Generator →

Same words, on paper

The quiet activity after the loud one. Free to print, answer keys included.

Crossword8.1b Sequence, Selection and Iteration · 8.1b Sequence, Selection and Iteration · 8.1b Sequence, Selection and Iteration and 8.1c Procedures and Functions · all 7

Word search8.1b Sequence, Selection and Iteration and 8.1c Procedures and Functions · 8.1b Sequence, Selection and Iteration · 8.1a Data Types and Variables and 8.1b Sequence, Selection and Iteration · all 5

Worksheetfor any module, with answer key

When your class is on devices — Snake Break and Diamond Dash run on the same modules, with a free class.

The 36 key terms

1sequence
Steps that run one after another in a set order. Changing the order, leaving a step out or adding an extra step can change the result.
2DECLARE Count : INTEGER
Names a variable (Count) and gives its data type (INTEGER) before use. Other types: REAL, STRING, BOOLEAN. Identifiers are capitalised with no spaces.
3Count <- 0
The <- operator stores the value on its right in the variable on its left. Count <- 0 puts 0 into Count. It is assignment, not a test for equality.
4INPUT and OUTPUT
INPUT stores a value the user types into a variable. OUTPUT displays a message or value on screen. Show several items by separating them with commas.
7DIV and MOD
Arithmetic operators beside + - * /. DIV gives the whole-number quotient (17 DIV 5 = 3). MOD gives the remainder (17 MOD 5 = 2). Number MOD 2 = 0 tests for even. Brackets set the order.
8= and <>
= tests whether two values are equal and <> tests whether they are not equal. Each gives TRUE or FALSE. Assignment uses <- instead, not =.
10AND
AND joins two conditions and is TRUE only when both are TRUE, e.g. Age >= 13 AND Age <= 19. If either condition is FALSE, the whole condition is FALSE.
12NOT
A logical operator that reverses a condition: NOT TRUE is FALSE and NOT FALSE is TRUE. For example, NOT (Score >= 50) is TRUE only when Score is below 50.
13truth table
A table that lists every combination of true and false inputs and shows the result of AND, OR or NOT for each one. Two inputs give four rows.
14(A OR B) AND C
Brackets are worked out first. Without them NOT is done first, then AND, then OR. So A OR B AND C means A OR (B AND C), and brackets change that order.
15IF condition THEN ... ENDIF
Runs the indented statements only when the condition is TRUE. If it is FALSE they are skipped. ENDIF closes the selection and lines up with IF.
16ELSE
Adds a second branch that runs when the IF condition is FALSE, so exactly one of the two branches runs. ELSE has no condition of its own and lines up with its IF.
17IF Age >= 13 AND Age <= 19 THEN
A compound condition joins tests with AND, OR or NOT so one IF checks several things at once. AND needs both tests true; OR needs at least one true.
18ELSE IF
A nested IF placed inside ELSE to choose between 3+ alternatives. Conditions are tested in order, only one branch runs, and every IF needs its own ENDIF.
19CASE OF Choice
Compares one variable (here Choice) with a list of values, runs the statement beside the matching value, and is closed by ENDCASE.
20OTHERWISE
The last clause of a CASE statement. It runs when the variable matches none of the listed values, e.g. OTHERWISE : OUTPUT "Invalid choice". Without it, nothing happens if no value matches.
22CASE OF
Use CASE OF when one variable is matched against fixed values, like a menu choice. Use IF when you test conditions with <, > or AND/OR, like age or score tests.
23FOR Count <- 1 TO 10
A count-controlled loop that repeats the indented lines end - start + 1 times, adding 1 to the counter each time. It is closed by NEXT Count, which names the same counter.
24FOR Count <- 10 TO 1 STEP -1
STEP sets how much the FOR counter changes each repeat. Without STEP the counter goes up by 1. A negative STEP, such as -1, makes the counter count down.
25OUTPUT Count * 7
Uses the FOR counter inside the loop body. Count holds a new value on each repeat, so this outputs a times table. Never change Count inside the loop; after the loop it keeps its last value.
26WHILE Number <> 0 DO
A pre-condition loop: the condition is tested before every repeat, so the body may run zero times. The loop keeps going while the condition is TRUE and is closed by ENDWHILE.
27WHILE Number <> -1 DO
Loop that repeats until the user types a rogue (sentinel) value such as -1. INPUT before the loop and again at the end of the body; the rogue value is not counted or totalled.
28REPEAT UNTIL
A post-condition loop: the body runs first, then UNTIL tests the condition. It always runs at least once and stops when the condition is TRUE. There is no ENDREPEAT.
29UNTIL X >= 10
Reverses WHILE X < 10. WHILE loops while TRUE, UNTIL stops when TRUE, so flip the condition. REPEAT also runs its body once before the first test.
30FOR, WHILE or REPEAT
Choose FOR when the number of repeats is known, WHILE when the loop may run zero times, and REPEAT...UNTIL when the loop must run at least once.
31Total <- Total + Number
Adds each new value to the running total inside a loop. Set Total <- 0 before the loop starts, then OUTPUT Total after the loop ends.
32Count <- Count + 1
Adds 1 to the counter each time the thing being counted happens. Set Count <- 0 before the loop, and put this inside the loop (inside an IF to count only some values).
33Average <- Total / Count
After the loop ends, divide the total by the count to get the mean. Check that Count > 0 first, so the program never divides by zero.
34UNTIL Mark >= 0 AND Mark <= 100
Ends a REPEAT loop only when Mark is valid (0 to 100). Input is asked again until it passes this range check, so the program only continues with valid data.
35nested IF
An IF placed inside the THEN or ELSE branch of another IF. It is only checked when that outer branch runs, and each IF needs its own ENDIF, with the inner ENDIF written first.
36CASE OF ... IF ... ENDIF ... ENDCASE
A CASE clause can hold an IF, and an IF branch can hold a CASE. Close the inner structure first with its own ENDIF or ENDCASE, then close the outer one.
37IF inside a loop
An IF or CASE placed in a loop body is tested again on every repeat, so each pass can take a different branch depending on the current value.
38IF...THEN FOR...NEXT...ENDIF
A loop written inside an IF branch only runs when that branch is chosen. If the condition is FALSE, it is skipped. NEXT ends the loop first, then ENDIF ends the IF.
39nested loop
A loop placed inside another loop. The inner loop completes all its repeats for every single repeat of the outer loop, so a 3 by 4 nest runs the inner body 12 times.
40nesting
Putting one structure inside another, three levels deep. Indent each level and close them in reverse order: innermost first, e.g. ENDIF, ENDIF, then NEXT.
41sequence, selection, iteration
Set counters to 0 first (sequence), loop to read input (iteration), use IF inside the loop to pick values to count or total (selection), then OUTPUT the result after the loop.

Frequently Asked Questions

Do I need an account?

No. Hangman runs straight from this page — no account, no sign-up, nothing to install. If you add your class names, they are saved in your own browser and never sent to Cloodit.

How do I play it with my class?

Put the page on your whiteboard or projector and press Play. The class calls out letters and you click or type them. Six wrong letters and the word gets away. After every word its definition appears, so each round ends on the meaning, not just the spelling.

Can I use my own words?

Yes. The free Hangman generator at cloodit.com/hangman/ takes any list: one word or phrase per line, with a definition after a dash if you want it shown at the end of the round.

Can I put my students' names in?

Yes. Add your class list and a random student is called for each word. The list stays in this browser on this computer, so it is still there next lesson.

Are the worksheets free too?

Yes. Every module in this journey has a free printable worksheet with a full answer key, and there are crosswords and word searches built from the same key terms.

More IGCSE Hangman

IGCSE Computer Science 0478 — 1.1 Number Systems23 key terms IGCSE Computer Science 0478 — 1.2 Text, Sound and Images20 key terms IGCSE Computer Science 0478 — 1.3 Data Storage and Compression45 key terms IGCSE Computer Science 0478 — 2.1 Data Transmission Types and Methods36 key terms IGCSE Computer Science 0478 — 2.2 Methods of Error Detection39 key terms IGCSE Computer Science 0478 — 2.3 Encryption19 key terms Make your own hangman →Paste any word list and play