Skip to content

← Grade 7 Computing

Exam practice

Every question from the end of every unit, with hints and answers to open. After you check an answer, mark how you did, and come back to the ones you didn’t get.

14 questions

Unit 2 · How Computers Store Everything

a.

Explain the meaning of these words: character code, ASCII, Unicode, code point, font, overflow, RGB, sample.

Answer
  • Character code: the number a computer stores for a character (a letter, digit, space or symbol).
  • ASCII: an early table of character codes using 7 bits (128 codes) for English letters, digits, punctuation and control codes; for example A = 65.
  • Unicode: one table of codes for the characters of every writing system in the world, including Devanagari and emoji; its first 128 codes are ASCII’s.
  • Code point: a character’s number in Unicode, such as 2325 for क.
  • Font: a file of drawings (shapes) for characters; it decides how the stored codes look on the screen.
  • Overflow: when the answer to a calculation needs more bits than the computer keeps for it, so the extra bit is lost and the stored number is wrong.
  • RGB: storing a color as three numbers from 0 to 255, for its red, green and blue light.
  • Sample: one measurement of a sound wave, kept as a number; sound is stored as many samples a second.
b.

Change into binary by halving, and check each answer by adding place values: i. 13 ii. 45 iii. 130 iv. 255

Answer
  • i.13 → 6 r 1 → 3 r 0 → 1 r 1 → 0 r 1. Read upwards: 1101. Check: 8 + 4 + 1 = 13.
  • ii.45 → 22 r 1 → 11 r 0 → 5 r 1 → 2 r 1 → 1 r 0 → 0 r 1. 101101. Check: 32 + 8 + 4 + 1 = 45.
  • iii.130 → 65 r 0 → 32 r 1 → 16 r 0 → 8 r 0 → 4 r 0 → 2 r 0 → 1 r 0 → 0 r 1. 10000010. Check: 128 + 2 = 130.
  • iv.255 → 127 r 1 → 63 r 1 → 31 r 1 → 15 r 1 → 7 r 1 → 3 r 1 → 1 r 1 → 0 r 1. 11111111. Check: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255.
c.

Add these binary numbers. Check each answer in decimal.

  • i.0011 + 0100
  • ii.0111 + 0001
  • iii.1011 + 0110
  • iv.00111100 + 00011110
Answer
  • i.0011 + 0100 = 0111 (3 + 4 = 7). No carries.
  • ii.0111 + 0001 = 1000 (7 + 1 = 8). The carry runs all the way along: 1 + 1 = 10, then 1 + 1 = 10, then 1 + 1 = 10, then 0 + 1 = 1.
  • iii.1011 + 0110 = 10001 (11 + 6 = 17). It needs 5 bits: in 4 bits it would overflow.
  • iv.00111100 + 00011110 = 01011010 (60 + 30 = 90).
d.

An 8-bit computer adds 11110000 and 00100000.

  • i.What is the true answer, in binary and in decimal?
  • ii.What does the computer’s byte hold?
  • iii.What is this problem called, and how can a program avoid it?
Answer
  • i.11110000 is 240 and 00100000 is 32. The true answer is 240 + 32 = 272 = 100010000 (9 bits).
  • ii.The 9th bit is lost, so the byte holds 00010000 = 16 (272 − 256 = 16).
  • iii.Overflow. A program can avoid it by keeping the number in more bits (for example 16 bits, which go up to 65,535), or by checking whether an answer is too big before using it.
e.

Use Figure 2.1 to decode this message: 75 97 116 104 109 97 110 100 117

Answer

75 = K, 97 = a, 116 = t, 104 = h, 109 = m, 97 = a, 110 = n, 100 = d, 117 = u. The message is Kathmandu.

f.

Why was Unicode needed when ASCII already existed? Give two reasons.

Answer
  1. ASCII has only 128 codes, enough for English but with no room for the letters of other scripts such as Devanagari, Chinese or Arabic.
  2. Before Unicode, different countries and companies made their own different tables for their own letters, so text made on one computer turned into nonsense on another. Unicode is one table that every device in the world uses, so a message shows the same everywhere.
g.

The word किताब looks like it begins with ि. In what order are its codes stored, and why does it look different on the screen?

Answer

It is stored in the order it is said: क, ◌ि, त, ◌ा, ब (2325, 2367, 2340, 2366, 2348). The vowel sign ि belongs to क, so it is stored after it. The font draws ि on the left of its consonant, because that is how Devanagari is written: the stored order is the order of the sounds, and the font decides the shapes and where they go.

h.

Rita opens a notice her father typed in 2008 and sees ;"rgf. On her father’s old computer it showed सूचना.

  • i.Why does Rita see different letters?
  • ii.Why can’t she find the notice by searching for सूचना?
  • iii.How can she fix the file? What must she check after fixing it?
Answer
  • i.The notice was typed in the Preeti font, which saves English letters and only draws them as Nepali shapes. Rita’s computer doesn’t have the Preeti font (or shows the text in another font), so she sees the English letters that are really stored.
  • ii.A search compares stored codes. The file holds the codes of the English letters ; " r g f, not the Nepali codes of स ू च न ा, so a search for सूचना can’t match it.
  • iii.She can copy the text into a Preeti-to-Unicode converter and convert it, then save it with a Unicode font such as Kalimati or Mukta. She must read the result carefully and correct any words that came out wrong, and check that the converter was set to the right old font.
i.

How does a spell-checker decide that a Nepali word is wrong? Give one kind of mistake it can’t catch.

Answer

It has a long list of correct words, with rules for the endings each word can take (such as मा, को, हरू). It takes the word underneath each typed word’s ending and looks it up. If it isn’t in the list, the word is marked as wrong, and words in the list that differ by one or two letters are suggested.
It can’t catch a real word used in the wrong place, such as घर typed instead of घाम: both are in the list. (It also can’t check Preeti text, which isn’t stored as Nepali letters.)

j.

Write the RGB numbers for: i. black ii. red iii. yellow iv. cyan. Explain why red and green light make yellow, when red and green paint don’t.

Answer
  • i.black: 0, 0, 0
  • ii.red: 255, 0, 0
  • iii.yellow: 255, 255, 0
  • iv.cyan: 0, 255, 255

A screen adds light: red and green light together reach the eye and work the eye’s red-sensitive and green-sensitive cells at once, which the brain sees as yellow. Paint works the other way round: each paint takes away (absorbs) some colors from white light, so mixing two paints takes away even more and gives a darker color.

k.

A picture is 800 pixels across and 600 pixels down, with 3 bytes a pixel.

  • i.How many pixels does it have?
  • ii.How many bytes do the pixels need?
  • iii.About how many MB is that?
Answer
  • i.800 × 600 = 480,000 pixels.
  • ii.480,000 × 3 = 1,440,000 bytes.
  • iii.1,440,000 ÷ 1,024 ÷ 1,024 ≈ 1.4 MB.
l.

Give three differences between raster and vector pictures. Which would you use for: i. a photo of your class ii. the logo of a cooperative iii. a map of the school’s fire exits to print on a large board?

Answer
Raster Vector
stores the color of every pixel stores shapes (lines, curves, circles) with their colors
goes blocky when made bigger stays sharp at any size
file size depends on the number of pixels file size depends on the number of shapes
best for photos and detailed pictures best for logos, icons, diagrams, maps and letters
  • i.Raster: a photo is full of detail with no simple shapes.
  • ii.Vector: a logo is a few clean shapes, used at many sizes.
  • iii.Vector: a map of lines and shapes, which must stay sharp when printed large.
m.

Explain how a sound is stored in a computer. What two choices decide how good the stored sound is, and what does each cost?

Answer

A microphone turns the sound’s pressure waves into an electric signal that rises and falls like the wave. The computer measures this signal many times a second; each measurement is a sample, stored as a number in binary. To play it back, the numbers are sent to a speaker at the same speed.

  • The sample rate (samples a second): more samples catch quicker changes, the high sounds, but there are more numbers to store.
  • The bits a sample: more bits give more levels, so each sample is rounded less and the sound is smoother, but each sample takes more space.

Better sound in both ways means a bigger file.

n.

A voice message is stored with 8,000 samples a second, 8 bits each, for one loudspeaker. How many bytes does a 30-second message take? How many KB?

Answer

8 bits = 1 byte a sample. Bytes a second = 8,000 × 1 = 8,000 bytes.
For 30 seconds: 8,000 × 30 = 240,000 bytes.
In KB: 240,000 ÷ 1,024 ≈ 234 KB.