← ACARA Digital Technologies Years 9–10 — Modular and Object-Oriented Programming (JavaScript)

ACARA Digital Technologies Years 9–10 — Modular and Object-Oriented Programming (JavaScript) Hangman

Years 9–10 · Australian Curriculum · 59 key terms.

Theme
Words

Every word, shuffled.

Players

Writing JavaScript programs in reusable pieces, including with classes and objects. 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.

CrosswordModular and Object-Oriented Programming (JavaScript) · Modular and Object-Oriented Programming (JavaScript) · Modular and Object-Oriented Programming (Python) and Modular and Object-Oriented Programming (JavaScript) · all 15

Word searchModular and Object-Oriented Programming (JavaScript) · Arrays & Strings to Advanced JavaScript · Getting Started to Arrays & Strings · all 11

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 59 key terms

1console.log()
Prints a value or message to the browser or terminal console for debugging or output.
2let
Declares a variable whose value can be changed later.
7for
Repeats a block of code a set number of times, using an initializer, condition, and update expression.
8decomposition
Splitting a big problem into smaller sub-problems, such as input, process and output. Each part can be solved on its own, then the solutions are combined.
9test each sub-problem separately
Each sub-problem is tested on its own before being joined to the rest, so an error is traced to the part that causes it and only that part needs fixing, not the whole program.
10function
Declares a reusable block of code with a name, which can be run later by calling it.
11camelCase
A naming style with no spaces: the first word is lowercase and each later word starts with a capital letter, like studentScore. PascalCase also capitalises the first word.
12parameter
A named placeholder inside a function's parentheses that receives an input value when called.
13return
Sends a value back out of a function and ends its execution at that point.
14undefined
The value a function gives back when it has no return statement. console.log only shows a value on screen, so a variable storing the result will hold undefined.
16scope
The area of code where a variable can be accessed; variables declared inside a function are local to it.
17return square(a) + square(b);
A function can call another function inside its body. Here square() is a helper, so the bigger function stays short and each function does one job.
18if (isValidAge(age))
A function that returns true or false can be called right inside an if condition. The if block runs only when the function returns true, like isEven(n) or isValidAge(age).
21callback
A function passed as an argument, without brackets, to another function that calls it later. Examples: nums.forEach(show) or nums.map(n => n * 2).
23array.length
A property (no brackets) giving how many items are in an array. The last index is length - 1, an empty array has length 0, and length grows as items are added.
24arr[arr.length]
Reading an index past the last item (or a negative index) does not crash. It gives undefined. The last valid index is length - 1, so scores[10] in a 10-item array is undefined.
25for (let i = 0; i < scores.length; i++)
A loop that counts i from 0 up to the last index, so scores[i] visits every item in the array. Use < not <=, or i goes one step past the end and reads undefined.
26for...of
Loops directly over each value in an array, without needing an index.
27push()
Adds one or more elements to the end of an array, changing the original array.
28pop(), shift(), splice()
Array methods that remove items and change the original array: pop removes the last item, shift removes the first, splice(index, count) removes count items starting at index.
29includes(value)
Array method that gives true if the value is in the array, otherwise false. Its partner indexOf(value) gives the position, or -1 if the value is not found.
30function total(scores)
A function with a parameter that receives an array when called, e.g. total([4, 7, 9]). The function can loop over it, return a new array, or change the original array.
31total += num
Adds each array item to a running total inside a loop. Set let total = 0 before the loop, then return total. Divide by nums.length for the average.
32let largest = nums[0];
Start by treating the first array item as the largest, compare every other item, replace it when a bigger one is found, then return it. Smallest works the same way.
33forEach()
Calls a given function once for every element in an array.
34map()
Creates a new array by running a given function on every element of the original array.
35filter()
Creates a new array containing only the elements that pass a test provided by a function.
36reduce()
Combines every element of an array into a single value using an accumulator function.
37error message
The console text that names the error type, such as SyntaxError or TypeError, and the line number where it happened, so you know what went wrong and where to look.
38console.log(label, value)
A temporary line that prints a variable's value while the program runs, so you can see where it goes wrong. Add a label to tell values apart, then remove it once fixed.
39Trace table
A table that records the value of each variable at every step of an algorithm, used to check its logic by hand.
40breakpoint
A marker on a line in browser DevTools that pauses the program there, so you can step through the code line by line and watch the variables change.
41bug
A mistake in code that gives wrong results. Common ones: a missing return, <= instead of < in an index loop, a total set inside the loop, or calling a function without ().
42try...catch
Runs code in a try block, and if an error occurs, runs the catch block instead of crashing.
43throw
Creates a custom error and immediately stops the current code from running further.
44Boundary values
Test inputs at the edge of a condition. For age >= 18, test 17 (just below), 18 (exactly on) and 19 (just above) to check the algorithm picks the right path at the edge.
45console.assert(condition, message)
Prints the message only when the condition is false, so a test like console.assert(add(2, 3) === 5) stays silent when the function gives the expected result.
46modify code
Read the code and predict its output, change one small part at a time, then re-run your tests after each change to check that nothing else broke.
47OOP
Object-oriented programming: building a program from objects that bundle related data with the code that uses it, modelling real things and reusing a blueprint.
48class Dog
A blueprint for dogs. An object like Rex is made from it. Properties are its data (nouns like name) and methods are its actions (verbs like bark).
50student.age = 16
Assigning to object.property with = changes an existing property or adds a new one if it is not there yet. Reading a property that does not exist gives undefined.
51obj.pets[0]
Chains dot notation and bracket notation to access a value nested inside an object.
52greet() { ... }
A method is a function stored as an object property. Write it inside the object, then call it with a dot and brackets: person.greet().
53class
Declares a blueprint for creating objects with shared properties and methods.
54constructor
A special method inside a class that runs automatically when a new instance is created.
55new ClassName(arguments)
Creates an object from a class and passes the arguments to the constructor. Store it in a variable, e.g. const rex = new Dog('Rex', 3). Leaving out new causes an error.
56this.name
Inside a class, this means the object being worked on, so this.name is that object's own name property. Leaving out this causes a ReferenceError.
57object.property
Reads a property of an object, like rex.age. To change it, assign a new value: rex.age = 4. Each object keeps its own values.
58method
A function declared inside a class body, called on an instance using dot notation.
59deposit(amount) { this.balance += amount; return this.balance; }
A class method takes a parameter (amount) and uses return to give back a value worked out from the object's properties, such as the new balance.
60this.balance += amount
A method line that updates the object's own property, so its state changes each time the method is called. Calling deposit(50) twice adds 50 twice.
61new Pet()
Each new Pet() makes a separate object from the same class. Every object has its own property values, but all of them share the same methods. Changing one object does not change the others.
62students.push(new Student('Ava', 7));
Makes a new Student object and adds it to the end of the students array. You can then loop over the array and call each object's methods.
63this.methodName()
Inside a class, a method calls another method of the same object by writing this. before its name, such as this.isPassing(). Forgetting this. causes a ReferenceError.
64class diagram
A box listing a class's name, attributes and methods. An arrow joins a child class to the parent it inherits from. You draw it as a plan before writing the code.
65properties and methods
Read the scenario: nouns (data to store) become properties and verbs (actions) become methods. Keep only the details the program needs and leave the rest out.
66this.score = score;
Modifying a class: add or change a constructor parameter, property or method, then update every new call that creates its objects and re-run your tests.
67new Pet(name, age)
Common class bugs: forgetting new, leaving out this. in the constructor, swapping the arguments, or misspelling a property so it reads undefined.
68modular program
A program built from small parts: a class for the data, an array of its objects, and helper functions that each do one job (like totals or searches), all run by a main function.

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 Australian Curriculum Hangman

ACARA Digital Technologies Years 5–6 — Inside Digital Systems18 key terms ACARA Digital Technologies Years 5–6 — Networks and Sharing Data25 key terms ACARA Digital Technologies Years 5–6 — Representing Data with Numbers36 key terms ACARA Digital Technologies Years 5–6 — Algorithms with Branching and Repetition40 key terms ACARA Digital Technologies Years 5–6 — Staying Safe Online38 key terms ACARA Digital Technologies Years 5–6 — Digital Footprints55 key terms Make your own hangman →Paste any word list and play