Class 8 Computer Science — Text as numbers
Work out the code number a character is stored as, and how many bytes a piece of text needs.
Name: ________________________
1.Small a is stored as 97 and the small letters carry straight on from there. What number is stored for small f?
2.Capital A is stored as 65 and small a is stored as 97. How much bigger is the code for a small letter than the code for the capital of the very same letter?
3.Capital A is stored as 65 and the capital letters carry straight on from there. Which capital letter is stored as 72?
4.In a computer's character code, capital A is stored as 65 and the capital letters that follow carry straight on. What number is stored for capital D?
5.Digit characters run in order from 48, capitals from 65 and small letters from 97. Put these characters in order of the code number stored for each, smallest first.
- the digit character 7
- capital B
- small z
- capital M
- small d
6.The capital letters run in order from 65 and the small letters run in order from 97, twenty-six of each. Sort each code number by which kind of letter it stands for.
Groups: A capital letter · A small letter
- 78
- 115
- 99
- 70
- 104
- 88
7.Each message is stored one character per byte, gaps included. Match each message to the number of bytes it needs.
- YES
- HELLO
- OK NOW
- GOODBYE
- I AM HERE
- 6
- 9
- 7
- 5
- 3
8.A message is stored with two bytes for every character. How many bytes does the word MOON need?
Answer key — Class 8 Computer Science — Text as numbers
- 1. 102
- 2. 32
- 3. H
- 4. 68
- 5. 1. the digit character 7 2. capital B 3. capital M 4. small d 5. small z
- 6. 70 → A capital letter; 99 → A small letter; 88 → A capital letter; 104 → A small letter; 78 → A capital letter; 115 → A small letter
- 7. YES → 3; HELLO → 5; OK NOW → 6; GOODBYE → 7; I AM HERE → 9
- 8. 8