← ACARA Digital Technologies Years 9–10

Choosing properties and methods for a class from a scenario

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.

Understanding Choosing properties and methods for a class from a scenario in ACARA Digital Technologies Years 9–10

What it does: Each noun the program needs becomes a property, set inside the constructor. Verbs describe what the object does, so they are written as methods inside the class. Nouns that describe stored data, like name and score, become properties. Words like 'has' are not data. Borrowing is an action, so it becomes a method. The title is data, so it is a property. Keep only the details the program needs. Extra data makes the class harder to read and maintain. The noun balance is stored data (a property). Deposit and withdraw are actions (methods). The vet's phone number is not used by the program, so it is left out. The name is needed to show each pet.

Common mistakes: A class declaration does not take parentheses after its name. The class that holds the Pet's properties (name, age) should start with class Pet {. The method that sets up the properties must be spelled constructor. With the typo, JavaScript treats it as an ordinary method and the properties are never set when you use new.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 743–781) and word search (Modules 743–809).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A game needs a Player class. The scenario says: 'A player has a name and a score.' Which are properties?
has and needsname and score
Matches
class Book { constructor(title, authorsFavouriteColour, coverPhotoSize) { } }
↓
It stores details the program does not need. Leave out unneeded detail like favourite colour and photo size.
Applying
Meanings
Term
properties and methods
Meaning
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.
Practice
class LunchCard {
Testing
Gaps
constructor(name) { this. = name; }
Check Answer
Spots
1class Pet {
2class Pet() {

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Walrus' badge — Method Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A game needs a Player class. The scenario says: 'A player has a name and a score.' Which are properties?
A. name and score ✓
B. has and needs
Nouns that describe stored data, like name and score, become properties. Words like 'has' are not data.
2. A scenario says: 'A dog can bark and sit.' How should bark and sit be written in the Dog class?
A. As properties: this.bark and this.sit
B. As methods: bark() and sit() ✓
Verbs are actions, so they become methods. Properties store data, while methods do things.
3. A library program tracks books. The scenario says: 'A book has a title, an author and can be borrowed.' Which is the best method name?
A. borrow() ✓
B. title()
Borrowing is an action, so it becomes a method. The title is data, so it is a property.
4. A school canteen program only needs each Student's name and lunch order. The scenario also mentions their favourite colour and pet's name. What should you do?
A. Leave out favourite colour and pet's name ✓
B. Add them all as properties just in case
Keep only the details the program needs. Extra data makes the class harder to read and maintain.
5. Scenario: 'A bank account has a balance. You can deposit and withdraw money.' Which list is correct?
A. Properties: deposit, withdraw. Method: balance()
B. Property: balance. Methods: deposit(), withdraw() ✓
The noun balance is stored data (a property). Deposit and withdraw are actions (methods).

Match the Pairs

this.balance = 0; → A property: the noun 'balance' is data the object stores
deposit(amount) { this.balance += amount; } → A method: the verb 'deposit' is an action the object can do
Scenario: 'A student has a name and a house.' The nouns name and house are stored as properties. → constructor(name, house) { this.name = name; this.house = house; }
Scenario: 'A game character can jump.' The verb jump becomes a method. → class Player { jump() { console.log('Jump!'); } }
class Book { constructor(title, authorsFavouriteColour, coverPhotoSize) { } } → It stores details the program does not need. Leave out unneeded detail like favourite colour and photo size.
class Dog { constructor() { this.bark = 'Woof'; } } → Bark is a verb (an action), so it should be a method, not a property.

Key Term

properties 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.

Fill in the Blanks

1. // Scenario: a student has a name. constructor(name) { this.name = name; }
Hint: A noun in the scenario becomes a property. Type the property name.
2. // Scenario: a dog can bark. class Dog { bark() { console.log("Woof!"); }
Hint: A verb in the scenario becomes a method. Type the method name.
3. // A player can add points to the score. player.addPoints(5);
Hint: Type the method name that matches the action in the comment, written in camel case.
4. // Needed: title and borrowed (not colour) this.borrowed = false;
Hint: Type the second property the program needs. The unneeded detail is left out.
5. // A cat is hungry until it eats. eat() { this.hungry = false; }
Hint: Type the property that this method changes, as described in the scenario.

Spot the Error

Question 1
A class Pet {
B class Pet() {
C this.name = name;
D this.age = age;
E }
F }
Line B — A class declaration does not take parentheses after its name. The class that holds the Pet's properties (name, age) should start with class Pet {.
Question 2
A class Player {
B constructor(name, score) {
C constructer(name, score) {
D this.score = score;
E }
F }
Line C — The method that sets up the properties must be spelled constructor. With the typo, JavaScript treats it as an ordinary method and the properties are never set when you use new.
Question 3
A Class Car {
B constructor(model) {
C this.model = model;
D }
E drive() { return 'Vroom'; }
F }
Line A — The class keyword must be lowercase because JavaScript is case sensitive. It should be class Car {.
Question 4
A class Dog {
B constructor(name, breed) {
C name = name;
D this.breed = breed;
E }
F }
Line C — The noun 'name' should be stored as a property, so it needs this.name = name;. Without this, the value is not saved on the object.
Question 5
A class Light
B constructor() {
C this.isOn = false;
D }
E }
Line A — The class body must be opened with a curly brace. The line should be class Light {.

Student with a class code? Join your class →