Grade 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.Capitals are stored from 65 and small letters from 97. A computer puts a list of words in order by the code number of the first character. Which of these words does it put first?
- a) Zebra
- b) banana
- c) apple
- d) cherry
2.A code with one byte per character can tell apart 256 different characters. Why is one byte per character not enough for the writing used around the world?
- a) Every character needs a whole byte of its own even when it is only a letter
- b) Every language would need a computer built specially for it
- c) Punctuation marks and gaps are not characters and have to be stored some other way
- d) The writing systems of the world need far more than 256 different characters between them
3.A message is stored with two bytes for every character. How many bytes does the word MOON need?
4.Every character takes one byte. How many bytes does the word ORBIT need?
5.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?
6.Small a is stored as 97 and the small letters carry straight on from there. What number is stored for small f?
7.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.
- small d
- small z
- the digit character 7
- capital M
- capital B
8.Every character takes one byte, and the gaps between words are characters in their own right. How many bytes does the message GO TO BED need?
Answer key — Grade 8 Computer Science — Text as numbers
- 1. a) Zebra
- 2. d) The writing systems of the world need far more than 256 different characters between them
- 3. 8
- 4. 5
- 5. 68
- 6. 102
- 7. 1. the digit character 7 2. capital B 3. capital M 4. small d 5. small z
- 8. 9