---
marp: true
theme: default
html: true
---

# Text or number?

Starting out · Numbers and switches

<!-- Speaker note: Students see that 12 typed as text is two characters with their own codes, compare adding numbers with joining text, and choose number or text for each box on a sign-up form (AC9TDI6K03 node 2). About 35 minutes (Predict and Try 6 min · Worked example 10 min · Vary 6 min · Practise and Make 13 min). -->

---

## Today

- I can say what a computer does with numbers and with text.
- I can explain why 12 and 3 can make 15 or 123.
- I can choose whether a form should store something as a number or as text.

<!-- Speaker note: Before class: Do the Try board yourself: type 12, then 123. The one idea: the type of data (number or text) decides what the computer can do with it. Numbers add; text joins. Simplification: in programs this is "string" and "integer"; spreadsheets show it as a number lined up on the right and text on the left. Neither word is needed here. Year 7–8 catch-up: Text as numbers (8K03 n2) assumes students know a digit in text is a character; this lesson is that idea. Teacher: Try: ask why 12 needs two numbers here but would need one as a number. Teacher: Worked example: ask what goes wrong if a phone number loses its 0. -->

---

## Why it matters

> 12 and 3 make 15. But a computer can also turn 12 and 3 into 123. How does it know which to do?

<!-- Speaker note: When you type 12, the computer has to decide: is it the number twelve, or the two characters 1 and 2? -->

---

<span style="background:#dbeafe; color:#1a1a1a; border:1.5px solid #3b82f6; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">💬 Discussion</span>

## Think, pair, share

**Your phone number is digits. Should a computer store it as a number or as text?**

- Would you ever add two phone numbers?
- What happens to the 0 at the front if it's stored as a number?

<!-- Speaker note: Text: no maths is ever done with it, and a number would drop the leading 0 (0412 becomes 412). The rule students should leave with: will we do maths with it? Then a number. If not, text. Give 30 seconds alone, 2 minutes in pairs, then take answers from both sides. There is no single right answer: ask for a reason, and let students change their minds. -->

---

<span style="background:#dbeafe; color:#1a1a1a; border:1.5px solid #3b82f6; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">💬 Discussion</span>

## Predict

**A form has two text boxes. Ana types 12 in one and 3 in the other. The form joins the two pieces of text together. What does it show?**

- 4
- 15
- 123
- 12 3

<!-- Speaker note: What happens: 123. Joining text puts one piece after the other. Only numbers get added. Take two or three predictions before anyone runs it. -->

<!-- Speaker note: Teacher: students who chose 15 added; ask what joining two words does. -->

---

<span style="background:#fef3c7; color:#1a1a1a; border:1.5px solid #f59e0b; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✍️ Activity</span>

## Join or add? <span style="font-size:.6em;color:#64748b">(3 min)</span>

Two cards: 12 and 3. One group joins them like words (put them side by side). The other adds them. Compare.

<!-- Speaker note: 123 and 15. Same keys, different jobs. The board shows why: as text, 12 is two characters. -->

---

<span style="background:#fef3c7; color:#1a1a1a; border:1.5px solid #f59e0b; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✍️ Activity</span>

## Try it

{{embed: https://tutorials.learningwaypoints.com/_playground-board/index.html?id=deck%2Fsystems%2Fstarting%2Ftext-or-number%2Fstep-2&code=widget%3A+decode%0Anumbers%3A+72%2C+73%0Aas%3A+text%0Aswitch%3A+off%0Atype%3A+on%0Atable%3A+on%0A&fresh=1}}

[Open this step in the tutorial](https://tutorials.learningwaypoints.com/systems/starting/text-or-number/?full=step-2#step-2)

<!-- Speaker note: Was your guess right? -->

<style scoped>pre, marp-pre { font-size: 0.5em; line-height: 1.25; } section { font-size: 25px; }</style>

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## What happened?

* 123. Joining text puts one piece after the other. Only numbers get added.

<!-- Speaker note: Reveal after running. Ask who predicted it, and what made them think so. -->

---

<span style="background:#dbeafe; color:#1a1a1a; border:1.5px solid #3b82f6; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">💬 Discussion</span>

## 12 and 3, two ways

Now: which can be added?

$$12 + 3 = 15$$

1) $\text{12 joined to 3} = \text{123}$ — Stored as text: the computer puts one after the other.
2) $\text{"12"} \to 49,\ 50$ — As text, 12 is two characters, each with its own code.
3) $\text{the type decides}$ — Number or text: the computer stores which one it is, and that decides what it can do.

<!-- Speaker note: Model this live on the board before revealing anything: write each line and say why, pausing to ask the class what comes next. Then click to reveal the lines and compare. Script. Start: write 12 + 3 = 15 and say "Stored as numbers: the computer adds them." Line 1: write 12 joined to 3 = 123 and say "Stored as text: the computer puts one after the other." Line 2: write "12" 49,50 and say "As text, 12 is two characters, each with its own code." Line 3: write the type decides and say "Number or text: the computer stores which one it is, and that decides what it can do." -->

<style scoped>pre, marp-pre { font-size: 0.5em; line-height: 1.25; } section { font-size: 27px; }</style>

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## 12 and 3, two ways

**Which can the computer add up to make a total?**

- 12 stored as a number
- 12 stored as text
- Both
- Neither

* Answer: 12 stored as a number

<!-- Speaker note: Numbers can be added, taken away and sorted by size. Text can be joined and sorted A to Z. -->

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## Find the mistake

**Sam joins two text boxes. Click the line where it first goes wrong.**

```
 1  Sam types 12 in one text box and 3 in another, then joins them.
 2  Inside the computer, text is stored as numbers.
 3  So the computer adds them up: 12 + 3.
 4  The answer box shows 15.
```

* Answer: line 3

<!-- Speaker note: Line 3: text is stored as codes, but the computer doesn't add text. It joins it, so the box shows 123. -->

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## Phone numbers

**Why is a phone number like 0412 345 678 stored as text?**

- Text is faster
- It isn't: it's a number
- You never add them, and the 0 at the front must stay
- Phone numbers are too big to be numbers

* Answer: You never add them, and the 0 at the front must stay

<!-- Speaker note: As a number, 0412 would lose its 0 and become 412. As text, every character stays. -->

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## Which type?

**A shop's app adds up prices for a total. How should it store each price?**

- As a number
- As text
- As letters
- It doesn't matter

* Answer: As a number

<!-- Speaker note: It does maths with prices, so they're numbers. Ask on mini whiteboards or by show of hands before the reveal. -->

---

<span style="background:#fef3c7; color:#1a1a1a; border:1.5px solid #f59e0b; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✍️ Activity</span>

## Vary: what happens?



- **Add:** 
- **Join:** 
- **Join words:** 

<!-- Speaker note: What this step is for: Each task changes the type or the job: add numbers, join text, then join words. For students who need more support: A card: Number: add, take away, compare sizes. Text: join, sort A to Z, keep every character. For early finishers: A spreadsheet shows 0412 as 412. What happened, and how could you stop it? The hard part, on purpose: Thinking text that looks like a number is a number. Have them type 12 on the board and count the codes. When students get stuck: A student says the computer adds text that looks like numbers (Sam's mistake). Ask: What does joining cat and fish make? Now join 12 and 3. Fix: Text joins; only numbers add. / A student says a phone number is a number. Ask: Would you ever add two phone numbers? Fix: No maths, and the leading 0 must stay: text. -->

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## Score

**A game keeps your score and adds 10 every time you win. How should it store the score?**

- As a letter
- As text
- As a number
- Either works the same

* Answer: As a number

<!-- Speaker note: The game does maths with it, so it's a number. -->

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## Names

**A class list sorts names from A to Z. What type are the names?**

- Numbers
- Text
- Both
- Neither

* Answer: Text

<!-- Speaker note: Names are text: sorted A to Z by their letter codes, never added. -->

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## Review: codes

**Review: A is 65. What number is the letter F?**

* Answer: 70

<!-- Speaker note: Count on five from 65. -->

---

<span style="background:#fef3c7; color:#1a1a1a; border:1.5px solid #f59e0b; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✍️ Activity</span>

## Make: design a sign-up form

Then: think of a box on a real form. Would a number or text be safer?

<!-- Speaker note: What this step is for: Sorting a form's boxes by what the program will do with them reverses the move: students choose the type. -->

<!-- Speaker note: Teacher: let pairs argue about year level; adding 1 next year is the deciding job. -->

---

<span style="background:#dbeafe; color:#1a1a1a; border:1.5px solid #3b82f6; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">💬 Discussion</span>

## Year level: number or text? <span style="font-size:.6em;color:#64748b">(3 min)</span>

Stand on the left if year level should be a number, on the right if text. Be ready to say what the club will do with it.

<!-- Speaker note: Either is defensible until someone says 'next year we add 1'. That job makes it a number. -->

---

<span style="background:#dcfce7; color:#1a1a1a; border:1.5px solid #22c55e; padding:6px 18px; border-radius:8px; font-size:1em; font-weight:500;">✅ Check</span>

## Exit ticket

**A and B are 5 and 6. As numbers, what do they make together? As text?**

* 11 (added); 56 (joined).

<!-- Speaker note: Students answer on paper or a mini whiteboard before the reveal. Anyone who cannot answer needs the main idea again next lesson. Where this leads: Next: On or off (how switches store numbers). Year 7–8: Everything is numbers; in Code, Python console › Text into numbers (int()). -->
