IGCSE Computer Science 0478 — 8.1a Data Types and Variables Hangman
Years 10–11 · IGCSE · 40 key terms.
Every word, shuffled.
The names stay in this browser on this computer — they are never sent to Cloodit. A random student is called for each word.
Storing values, naming them, working with strings and choosing the right type. 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.1a Data Types and Variables · 8.1a Data Types and Variables · 8.1a Data Types and Variables · all 5
Word search8.1a Data Types and Variables · 8.1a Data Types and Variables and 8.1b Sequence, Selection and Iteration · 7d Standard Methods of Solution and 8.1a Data Types and Variables
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 40 key terms
- 1variable
- A named storage location in memory whose value can change while a program runs, such as Score going from 0 to 10. Programs use it to remember values.
- 2CONSTANT
- A named value set once before the program runs that never changes, unlike a variable. Example: CONSTANT Pi ← 3.142 or CONSTANT HourlyRate ← 12.50 are fixed while the program runs.
- 3identifier
- The name of a variable, constant, procedure or function. Use PascalCase: letters and digits only, no spaces or underscores, start with a capital letter, e.g. FirstName.
- 4case insensitive
- Capital letters do not matter in identifiers, so Countdown and CountDown are the same name. Never use names that differ only in case as two separate variables.
- 5DECLARE Counter : INTEGER
- Creates a variable called Counter that can only hold whole numbers. Use DECLARE name : TYPE, with a space either side of the colon, before you use the variable.
- 6DECLARE Initial : CHAR
- DECLARE creates a variable and sets its type. Here Initial can hold one CHAR (a single character). Use : STRING instead for text, e.g. DECLARE FirstName : STRING.
- 7Counter ← 0
- Assignment: the value on the right of the arrow is stored in the variable on the left. Counter ← 0 stores 0 in Counter and replaces any earlier value.
- 8TotalToPay ← NumberOfHours * HourlyRate
- The expression on the right is worked out first, then its result is stored in the variable on the left, replacing any old value that variable held.
- 9type mismatch
- An error when a value assigned to a variable has a different data type from the one it was declared with, such as storing a name in an INTEGER variable.
- 10CONSTANT HourlyRate ← 6.50
- Declares a named value that is set once. No DECLARE line or data type is needed: the type comes from the literal, so 6.50 makes it REAL. The value cannot change later.
- 11CONSTANT Rate ← 6.50
- A constant must be set to a literal value, such as 6.50. It cannot be given a variable, another constant or an expression like Rate * 2.
- 12CONSTANT VatRate ← 0.2
- A named value used instead of a magic number. It makes code easier to read, and when the value changes you edit it in one place only, so no missed edits cause mistakes.
- 14INTEGER
- The data type for a whole number with no fractional part, written in denary digits, such as 5 or -3. Used for counts like lives: DECLARE Lives : INTEGER
- 15REAL
- The data type for a number that can have a fractional part, written with a digit on each side of the point, such as 4.7 or 0.3. 5 is an INTEGER but 5.0 is REAL.
- 16CHAR
- The data type for exactly one character (a letter, digit or symbol), written in single quotes, such as 'x', '7' or '@'. Even '7' is a character, not a number.
- 17STRING
- The data type for text: zero or more characters written between double quotes, such as "This is a string". "" is the empty string and "123" is text, not a number.
- 18BOOLEAN
- A data type with only two possible values, TRUE or FALSE, written without quotes. Used for yes/no information, e.g. DECLARE GameOver : BOOLEAN
- 197 7.0 '7' "7" TRUE
- How a literal is written shows its type: digits = INTEGER, decimal point = REAL, single quotes = CHAR, double quotes = STRING, TRUE or FALSE = BOOLEAN.
- 20INTEGER or REAL
- Use INTEGER for values that are always whole numbers, like a count of students. Use REAL if the value could have a decimal part, like a price or an average mark.
- 21CHAR or STRING
- Use CHAR for a value that is always exactly one character, like a grade letter or Y/N. Use STRING for text of any length, including none, like a name or phone number.
- 22data type
- Pick INTEGER, REAL, CHAR, STRING or BOOLEAN by what the value is and what you do with it, then justify with 'because'. Eg price is REAL because it has pence.
- 23OUTPUT
- OUTPUT displays a value to the user. OUTPUT "Hello" shows the text exactly as written. OUTPUT Score shows the value stored in the variable Score.
- 24OUTPUT "You have ", Lives, " lives left"
- One OUTPUT command can display several values, separated by commas. Mix text in quotes with variables. Any spaces you want shown must be inside the quotes.
- 25INPUT Answer
- Reads a value typed by the user and stores it in the variable named after INPUT (here Answer). Declare the variable first; its data type decides what can be entered.
- 26INPUT, ←, OUTPUT
- A simple program's order: DECLARE variables, INPUT values, calculate with an assignment (←), then OUTPUT the result. Each step must come before the one that uses it.
- 30DIV(a, b)
- Returns how many whole times b goes into a, discarding any remainder. DIV(10, 3) gives 3, but 10 / 3 gives 3.333. Both values are integers.
- 31MOD(10, 3)
- MOD(a, b) gives the remainder when integer a is divided by integer b, so MOD(10, 3) is 1. A result of 0 means exact division. MOD(n, 2) is 0 for even n and 1 for odd n.
- 32DIV(Total, Size) and MOD(Total, Size)
- DIV gives how many whole groups fit in the total, MOD gives what is left over. Together they split a total into whole units plus a remainder. E.g. 135 minutes is 2 hours 15.
- 33trace table
- A table with one column per variable. Follow the program line by line and write each variable's new value after every assignment, so you can predict the final OUTPUT.
- 34LENGTH(Text)
- Returns an INTEGER: the number of characters in the string, including spaces. LENGTH("Happy Days") returns 10 and LENGTH("") returns 0.
- 35SUBSTRING(<string>, <start>, <length>)
- Returns part of a string: length characters taken from the start position. SUBSTRING("Happy Days", 1, 5) gives "Happy". The result is always a string.
- 36SUBSTRING(Word, 1, 1)
- Position 1 is the first character in Cambridge pseudocode, so this returns the first letter. Some languages count from 0 instead, so state which numbering you use.
- 37UCASE(x)
- UCASE(x) returns the string or CHAR x with every letter in upper case. UCASE("Happy") returns "HAPPY". The original variable only changes if you assign the result.
- 38LCASE(Text)
- Returns the text with every character in lower case, e.g. LCASE("Hi") gives "hi". The original variable is unchanged unless you assign the result to it.
- 39UCASE(SUBSTRING(Name, 1, 1))
- Nesting string functions: the inner SUBSTRING runs first, then UCASE changes its result. This gives the first letter of Name in capitals, such as an initial.
- 40meaningful identifier
- A name that describes what a variable or constant holds, such as TotalToPay instead of T, so the program is easy to read and maintain.
- 41PascalCase
- Each word starts with a capital. Name arrays with nouns (StudentNames); name functions and procedures with verbs (CalculateTotal, DisplayMenu) to show what they store or do.
- 43// explain purpose
- A good comment explains why a section of code exists or a tricky step, without repeating the code word for word. Put it at the same indentation as the code it describes.
- 44DECLARE TotalScore : INTEGER
- Pseudocode layout convention: keywords in UPPER CASE, identifiers in PascalCase, and lines inside a statement indented four spaces. Meta-variables use angled brackets, like <identifier>.
- 45DECLARE INPUT OUTPUT
- A complete program declares variables and a CONSTANT, reads values with INPUT, processes them with assignments, then shows results with OUTPUT, using meaningful names and // comments.
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.