← Teacher guide

Letters are numbers

Students type words and read the numbers a computer stores for them, find that capitals go up in order from A = 65, that small letters, spaces and digits have codes too, then spell a word by setting its codes (AC9TDI6K03 node 1).

Starting out · Numbers and switches · about 35 minutes · Open the student lesson

Classroom resources

Open these in Waypoints Prepare with one click. To share a file another way, copy its address and paste it into Load URL, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.

Students will be able to

Timing

Predict and Try 6 min · Worked example 8 min · Vary 8 min · Practise and Make 13 min

Before class

Do the Try board yourself: type your name, then a space and a digit.

The one idea: every character has a number (its code), and a word is a list of codes in order. The codes are ASCII, which Unicode keeps for the first 128 characters; nothing here needs those names.

Year 7–8 catch-up: if students can find D's code (68) and read 72, 73 back as HI, go straight to Everything is numbers and Text as numbers.

Unplugged: a class code chart on the board; students write a secret message in codes for a partner.

Running the lesson

  1. Predict: students who chose 4 used the alphabet place; ask what A's number is.
  2. Try: whose name makes the longest list? Why?
  3. Worked example: before the T line, ask how far T is from A.
  4. Vary: ask why a space needs a number at all.
  5. Make: let students check by reading their numbers back as letters.

In class

On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.

The hard part (on purpose)

Using the alphabet place (C = 3) instead of the code. Have them type C on the board and read it aloud.

When students get stuck

What you will seeA question to askThe fix
A student says C is stored as 3 (Sam's mistake).Type C on the board. What number comes up?The codes start at A = 65, so C is 67.
A student thinks small and capital letters share a number.Type a, then A. Are the numbers the same?Small letters start at 97.

Answers to the checks

  1. what number is D?: A computer stores capital A as 65, B as 66 and C as 67. What number does it store for D?
    68. The codes go up by one, in alphabet order, starting from A = 65.
  2. Try: type a word: Type CAB in the box. What numbers does the computer store?

    67, 65, 66: one number for each letter, in the same order as the word.
  3. CAT: Small a and capital A: are they stored as the same number?
    No: small a has its own code, 97
    Capitals start at 65 and small letters start at 97. The computer treats them as different characters.
  4. Find the mistake: Sam works out how C is stored. Click the line where it first goes wrong.
    line 3
    Line 3: C's code isn't its place in the alphabet. The codes start at A = 65, so C is 67.
  5. A space: Type HI THERE, with a space. What number is the space?

    32. A space is a character too, so it needs a number.
  6. Small letters: Type hi in small letters.

    104 and 105: small letters start at a = 97, so h is 97 + 7 = 104.
  7. The digit 7: Type the number 7. What does the computer store?

    55. When you type it, 7 is a character, like a letter, so it gets a code: 55.
  8. E: A is 65. What number is E?
    69
    A, B, C, D, E: count on four from 65.
  9. Read it back: Your friend's phone receives 72, 73. What does it show?
    HI
    72 is H and 73 is I.
  10. Count them: How many numbers does the computer store for the message GO HOME?
    7
    Six letters and one space: seven characters, seven numbers.
  11. spell a word: Change the three numbers so the word says DOG.

    D is 68, O is 79, G is 71.

Solutions

One possible solution for each task. Other correct programs are fine.

Vary: other characters › A space

Open task: any program that does what the step asks.

Vary: other characters › Small letters

Open task: any program that does what the step asks.

Vary: other characters › The digit 7

Open task: any program that does what the step asks.

spell a word

Open task: any program that does what the step asks.

Stretch and support

Stretch: Find the code for ? and for !. Are they near the letters or somewhere else?

Support: A strip: A 65, B 66, C 67 … up to Z 90; a 97, b 98 …; space 32.

Exit ticket

What numbers does the computer store for BAD?

66, 65, 68.

What each step is for

Where it leads

Next: Text or number? (what the computer can do with each).

Year 7–8: Everything is numbers, then Text as numbers.