← ACARA Digital Technologies Years 5–6

Choosing a data type for a value

Ask what you will do with the value: calculate with it (number), join or show it (text), or answer yes/no (true/false). A phone number is text because you never add it.

Understanding Choosing a data type for a value in ACARA Digital Technologies Years 5–6

What it does: Quote marks show this is text. You show or join a phone number but you never do sums with it. Adding is a calculation, so the score must be a number. You add to a score, so it is a whole number. Numbers are the type you calculate with. Has finished? is a yes/no question, so true or false is the right type. Names are joined and displayed, so they are text. Numbers are for calculating. Adding is a calculation, and only numbers can be calculated with. The word because gives the reason for your choice. isCorrect is answered with yes or no, so true or false fits. The score would be a different value.

Common mistakes: A score is a whole number because we calculate with it. Adding the text "bonus" to a number is an error. It should be total = score + bonus. A phone number is text because we never add it, and a number would lose its leading 0. It should be phone = "0412345678" in quotes.

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 85–104) and word search (Modules 73–104).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A game keeps a player's score and adds 10 points each time they win. Which data type fits the score best?
Number, because you calculate with itText, because it has digits in it
Matches
phone = 0412345678
↓
A phone number is stored as a number, so the leading 0 is lost. It should be text: phone = "0412345678".
Applying
Meanings
Term
choose a data type
Meaning
Ask what you will do with the value: calculate with it (number), join or show it (text), or answer yes/no (true/false). A phone number is text because you never add it.
Practice
score ← 42
Testing
Gaps
score ← 42 // data type:
Check Answer
Spots
2bonus = 3
3total = score + "bonus"

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

The 'Moon Jellyfish' badge — Orbital Streak, 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 keeps a player's score and adds 10 points each time they win. Which data type fits the score best?
A. Number, because you calculate with it ✓
B. Text, because it has digits in it
You add to a score, so it is a whole number. Numbers are the type you calculate with.
2. Which data type is best for a phone number like 0412 345 678?
A. Text, because you never add phone numbers ✓
B. Number, because it is made of digits
A phone number is only shown or dialled, never added up. Also, a number would drop the 0 at the start. So we use text.
3. A game needs a value called hasFinished to show if a level is done. Which type should it be?
A. Text, because it is a word
B. True/false, because the answer is yes or no ✓
Has finished? is a yes/no question, so true or false is the right type.
4. You want to join a first name and a last name to show 'Mia Chen' on a screen. Which type do you use?
A. Number, because you combine two things
B. Text, because you join and show it ✓
Names are joined and displayed, so they are text. Numbers are for calculating.
5. Which sentence explains the choice for a student's age that you will add up to find a class total?
A. Number, because I will add the ages ✓
B. Text, because I will add the ages
Adding is a calculation, and only numbers can be calculated with. The word because gives the reason for your choice.

Match the Pairs

score = 42 → A score is a whole number because you add it up and compare it to other scores.
hasFinished = True → A yes/no answer such as 'has finished' is a true/false value.
A phone number is text because you never add it and you need to keep the leading 0. → phone = "0412 345 678"
Choose a number when you will calculate with the value, such as adding points. → total = score + 10
phone = 0412345678 → A phone number is stored as a number, so the leading 0 is lost. It should be text: phone = "0412345678".
hasFinished = "yes" → A yes/no answer is stored as text. It should be true/false: hasFinished = True.

Key Term

choose a data type
Ask what you will do with the value: calculate with it (number), join or show it (text), or answer yes/no (true/false). A phone number is text because you never add it.

Fill in the Blanks

1. score ← 42 // data type: number
Hint: Type the data type for a value you will add up and calculate with.
2. phone ← "0412 345 678" // data type: text
Hint: Type the data type for a value you only show or join, and never calculate with.
3. hasFinished ← true // data type: true/false
Hint: Type the data type used when the answer is yes or no.
4. phone is text because we never add it
Hint: Type the word that links your choice to its reason.
5. score is a number because we add scores
Hint: Type the action you do with scores that makes number the right type.

Spot the Error

Question 1
A score = 12
B bonus = 3
C total = score + "bonus"
D print(total)
Line C — A score is a whole number because we calculate with it. Adding the text "bonus" to a number is an error. It should be total = score + bonus.
Question 2
A phone = 0412345678
B print("Call " + phone)
C print(phone)
Line A — A phone number is text because we never add it, and a number would lose its leading 0. It should be phone = "0412345678" in quotes.
Question 3
A finished = "True"
B if finished:
C print("Well done!")
Line A — 'Has finished' is a yes/no answer, so it should be the true/false value True. In quotes it is just text. It should be finished = True.
Question 4
A name = "Zoe"
B score = 25
C has_won = score > 20
D if has_won == "True":
E print(name, "wins!")
Line D — has_won already holds a true/false value, so we use it directly. Comparing it to the text "True" is wrong. It should be if has_won:.
Question 5
A name = "Leo"
B qty = "six items"
C total = qty * 2
D print(name, total)
Line B — We will multiply the quantity, so it must be a number. Text like "six items" can't be used in a calculation. It should be qty = 6.

Student with a class code? Join your class →