← IGCSE Computer Science Paper 1

Barcode scanner

An input device that shines a laser across a barcode. Black lines absorb light, white gaps reflect it, and a sensor reads the pattern to get the product number.

Understanding Barcode scanner in IGCSE Computer Science Paper 1

What it does: The difference between absorbed and reflected light creates the pattern that the sensor reads. The barcode only stores a number, so the system searches a database with it to get the product details such as the price. A barcode scanner usually uses a laser to sweep light across the barcode so the reflected light can be read. It sends data into the computer, so it is an input device. Checkouts scan barcodes to find each product's price. Playing music is done by a speaker, an output device. Scanning an item identifies the product, so the database can reduce its stock count when it is sold or increase it when it is delivered.

Common mistakes: Black lines absorb light, they do not reflect it. The line should be: black lines ABSORB light. The sensor reads the reflected light pattern, it does not write to it. It should be sensor.read(light).

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 252–261) and word search (Modules 240–261).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does a barcode scanner usually shine across a barcode?
A laser beamA stream of ink
Matches
White gaps absorb light and black lines reflect it
↓
This is the wrong way round. Black lines absorb light and white gaps reflect it.
Applying
Meanings
Term
barcode scanner
Meaning
An input device that shines a laser across a barcode. Black lines absorb light, white gaps reflect it, and a sensor reads the pattern to get the product number.
Practice
pattern ← READ_REFLECTED_LIGHT()
Testing
Gaps
Black lines the scanner's light
Check Answer
Spots
2sensor READS reflected light
3black lines REFLECT light

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Reef Shark' badge — Reef Ruler, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does a barcode scanner usually shine across a barcode?
A. A stream of ink
B. A laser beam ✓
A barcode scanner usually uses a laser to sweep light across the barcode so the reflected light can be read.
2. Which part of a barcode absorbs the light?
A. The black lines ✓
B. The white gaps
Black lines absorb light, so very little is reflected back to the scanner.
3. Which part of a barcode reflects the light back to the scanner?
A. The black lines
B. The white gaps ✓
White gaps reflect light. The sensor detects this reflected light.
4. What does the scanner's light sensor turn the pattern of reflected light into?
A. Digital data ✓
B. A printed receipt
The sensor converts the pattern of reflected light into digital data that the computer can process.
5. The barcode itself stores the product's name and current price.
A. False: it stores a number that is looked up in a database ✓
B. True: all the details are inside the lines
The barcode holds a product number. The computer looks this number up in a database to find the name and price.

Match the Pairs

barcode scanner → An input device that shines a laser across a barcode and reads the reflected light to get the product number
reflected light pattern → The pattern of light bouncing back from the white gaps but not from the black lines, which the sensor reads
Black lines absorb light and white gaps reflect it, so the scanner can tell the lines and gaps apart → black = absorbs light, white = reflects light
The product number read from the barcode is looked up in a database to find the product name and price → price = database.lookup(number)
White gaps absorb light and black lines reflect it → This is the wrong way round. Black lines absorb light and white gaps reflect it.
The barcode itself stores the price of the product → A barcode only stores a product number. The price is found by looking the number up in a database.

Key Term

barcode scanner
An input device that shines a laser across a barcode. Black lines absorb light, white gaps reflect it, and a sensor reads the pattern to get the product number.

Fill in the Blanks

1. Black lines absorb the scanner's light
Hint: Type the verb for what black lines do to the light that hits them
2. White gaps reflect light back to the sensor
Hint: Type the verb for what white gaps do to the light that hits them
3. Sensor turns the pattern into digital data
Hint: Type the word for the kind of data a computer can process, which the sensor converts the reflected pattern into
4. Look up the number in a database for price
Hint: Type the name of the stored collection of product records that the barcode number is matched against
5. A laser is shone across the barcode
Hint: Type the name of the usual light source in a barcode scanner

Spot the Error

Question 1
A laser SHINES on barcode
B sensor READS reflected light
C black lines REFLECT light
D white gaps REFLECT light
Line C — Black lines absorb light, they do not reflect it. The line should be: black lines ABSORB light.
Question 2
A light ← laser.shine()
B pattern ← sensor.write(light)
C number ← decode(pattern)
Line B — The sensor reads the reflected light pattern, it does not write to it. It should be sensor.read(light).
Question 3
A WHILE items remain
B scan barcode
C price ← lookup(number)
D stock ← stock + 1
E ENDWHILE
Line D — Each time an item is scanned and sold, stock goes down. It should be stock ← stock - 1.
Question 4
A scan ← scanner.read()
B number ← decode(scan)
C product ← DB.find(price)
D OUTPUT product.price
Line C — The database is searched using the product number from the barcode. The price is the result found, so it should be DB.find(number).
Question 5
A IF line IS white THEN
B light ← absorbed
C ELSE
D light ← reflected
Line A — The IF branch sets light to absorbed, which only happens for black lines. The condition should be IF line IS black THEN.

Student with a class code? Join your class →