← All workbooksPrint double-sided, A4, black and white
GRADE 10 · TERM 4

Files, the Internet & Exam Revision

A pencil-and-paper workbook: save data in files, understand life online, then get exam-ready.

Name:
Class: Date:

How to use this workbook

  1. Work with a pencil. Mistakes are how we learn: rub out and try again.
  2. Start each unit with Think First. Try it on your own before you read the explanation.
  3. Read Learn It, then do the activities. Trace tables and code are written by hand.
  4. At the end of each unit, tick the “I can” boxes you are sure of. Write down anything you still want to ask.
  5. The checkpoint test is done under test conditions, with no notes.

In this workbook

  1. Files from first principles
  2. Internet services and online life
  3. Revision workout: practical
  4. Revision workout: theory on paper
  5. Exam skills
  6. Term checkpoint test
Matches the Annual Teaching Plan: Term 4 — file input and output from first principles (AssignFile, Reset, Rewrite, Append, ReadLn, WriteLn, EOF, CloseFile); internet services, online shopping and social media; revision of Terms 1–3 practical and theory.

UNIT 1Files from first principles

Variables disappear when a program closes. A file keeps data on the disk so that it is still there tomorrow. You will learn the few commands that open, read, write and close a text file, and you will use only these commands in your PAT and in exams.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

1.1The secretary's cabinet, again

In Term 3 you described how a school secretary stores a learner's details and takes them out again. Now think harder about the small steps.
(a) What must she do first, before she can read or write anything in a folder? (b) What must she do when she has finished? (c) What could go wrong if she forgets (b)? (d) While she reads a long folder page by page, how does she know it is time to stop?
THINK FIRST · no computer needed

1.2Three ways to open the marks book

The Grade 10 marks book is full of a whole term's marks. Three teachers open it in different ways. Mr A opens it at page 1 and only reads. Ms B tears out every page and starts with a clean empty book. Mrs C opens it at the first empty page and writes today's marks under the old ones.
Which teacher should worry you most? Which one is only reading? Which one keeps the old marks and adds new ones?
LEARN IT

Why files? And two names for one file

A variable lives in RAM. When the program closes, or the power goes off during load shedding, RAM is wiped and every value is gone. A text file is stored on the disk (hard drive, SSD or flash drive), so the data stays there until someone deletes it. A text file holds plain characters in lines, just like Notepad. Even a number in a text file is stored as text, so you must convert it with StrToInt before you calculate with it.

Think of a contact on your phone. The real phone number is the physical name. The name you tap, such as “Mom”, is a nickname that points to it. A file works the same way. The physical file name is the real name on the disk (for example Sales.txt). The logical file name is a variable of type TextFile that your program uses as a nickname. AssignFile links the two, and it must always come first.
Delphi
var
  tFile : TextFile;                  // logical name (a variable)
begin
  AssignFile(tFile, 'Sales.txt');    // link it to the physical name on the disk
  // from now on we only use tFile in the commands
LEARN IT

The file commands

Every file job follows the same pattern: link, open, work, close.
CommandWhat it does
AssignFile(tFile, 'Data.txt')Links the logical name to the physical name. Always first.
Reset(tFile)Opens an existing file for reading, starting at the first line.
Rewrite(tFile)Creates a new empty file for writing. If the file exists, everything in it is erased.
Append(tFile)Opens an existing file for writing at the end. Old lines are kept.
ReadLn(tFile, sLine)Reads one whole line into sLine and moves to the next line.
WriteLn(tFile, sText)Writes sText to the file as one new line.
EOF(tFile)End Of File: True when there is nothing left to read.
CloseFile(tFile)Saves the data and closes the file. Never forget it.

1.3Fill in the blanks [9]

The real name of a file on the disk, such as Sales.txt, is its name. The variable of type TextFile is the name. The command links the two. To read a file we open it with . To start a new file we use , which an old file with the same name. adds new lines at the of a file. The function is True when there are no more lines to read. Finally, we must always .
LEARN IT

Reading a file, line by line

while not EOF(tFile) means “keep going while there is still something left to read”. Each ReadLn takes one line and moves on, so the loop reaches the end by itself. Reset crashes the program if the file does not exist, so first ask FileExists.
Delphi
// declared: tFile : TextFile;  sLine : String;
if FileExists('Names.txt') then
begin
  AssignFile(tFile, 'Names.txt');
  Reset(tFile);                   // open for reading
  while not EOF(tFile) do
  begin
    ReadLn(tFile, sLine);         // one line per pass
    memOut.Lines.Add(sLine);
  end;
  CloseFile(tFile);               // always close
end
else
  ShowMessage('Names.txt was not found');
LEARN IT

Writing and adding to a file

Rewrite starts a new file (and wipes an old one). Append adds to the end of a file that already exists. The first time a program runs there is no file yet, so a common plan is to ask FileExists and choose Append or Rewrite.
Delphi
AssignFile(tFile, 'Sales.txt');
if FileExists('Sales.txt') then
  Append(tFile)                  // keep the old sales
else
  Rewrite(tFile);                // first sale ever: create the file
WriteLn(tFile, edtAmount.Text);  // one new line
CloseFile(tFile);

1.4Reset, Rewrite or Append? [5]

Circle the command that opens the file correctly for the job.

1Read the marks that are already in Marks.txt.Reset  Rewrite  Append
2Every Monday, create a fresh Report.txt and throw away last week's.Reset  Rewrite  Append
3Add today's sale to the end of Sales.txt without losing earlier sales.Reset  Rewrite  Append
4Show every line of Names.txt in a memo.Reset  Rewrite  Append
5Save the very first high score, when no file exists yet.Reset  Rewrite  Append

1.5Be the computer: read and add up [6]

Sales.txt holds four lines of text: 25, 40, 15 and 60 (one rand amount per line). Complete a row for every check of the loop. The last row is the check that stops the loop, and the values stay as they were.

Delphi
iTotal := 0;
AssignFile(tFile, 'Sales.txt');
Reset(tFile);
while not EOF(tFile) do
begin
  ReadLn(tFile, sLine);
  iAmount := StrToInt(sLine);
  iTotal := iTotal + iAmount;
end;
CloseFile(tFile);
CheckEOF(tFile)sLineiTotal
1
2
3
4
5

1.6Think critically [2]

Someone saves Sales.txt and accidentally leaves an empty line at the end. What happens when the loop reads that line, and why?

1.7What is in the file? [3]

Log.txt does not exist before this code runs. Write the lines that Log.txt contains after each of the three blocks.

Delphi
AssignFile(tFile, 'Log.txt');   // block 1
Rewrite(tFile);
WriteLn(tFile, 'Monday');
WriteLn(tFile, 'Tuesday');
CloseFile(tFile);
AssignFile(tFile, 'Log.txt');   // block 2
Append(tFile);
WriteLn(tFile, 'Wednesday');
CloseFile(tFile);
AssignFile(tFile, 'Log.txt');   // block 3
Rewrite(tFile);
WriteLn(tFile, 'Thursday');
CloseFile(tFile);

1.8Debug: the broken reader [4]

This code should add up the numbers in Numbers.txt and show the total. Find four errors.

Delphi
var
  tFile : TextFile;
  sLine : String;
  iTotal : Integer;
begin
  iTotal := 0;
  Reset(tFile);
  while EOF(tFile) do
  begin
    ReadLn(sLine);
    iTotal := iTotal + StrToInt(sLine);
  end;
  lblTotal.Caption := IntToStr(iTotal);
end;

1.9Draw the connection [4]

Draw a simple diagram that shows: your Delphi program with the variable tFile, the file Marks.txt on the disk, and what AssignFile, Reset and ReadLn do. Use arrows and short labels.

1.10Write it: total and count [8]

Sales.txt holds one whole-rand amount on each line. Write code that displays the total in lblTotal and the number of sales above R30 in lblBig. Check that the file exists first. (Variables: tFile, sLine, iAmount, iTotal, iBig are declared.)

1.11Write it: add a result [4]

A learner's name is typed in edtName and the mark in edtMark. Add one line to the existing file Results.txt in the form Thabo: 56, keeping the lines already in the file.

1.12Challenge: read one file, write another [6]

Names.txt holds one learner name per line. Write code that copies only the names that start with S into a new file SNames.txt. You need two file variables: tIn and tOut.

How did I do with this unit? I got it   Nearly there   I need help
One thing I want to ask my teacher:

UNIT 2Internet services and online life

Most of what you do on a phone happens through internet services. You will learn what online storage, synchronisation and collaboration mean, how to shop and share safely, and how to write answers that earn full marks.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

2.1Stolen at the taxi rank

Thandi's phone is grabbed at the taxi rank. It held her photos, her half-finished Maths project and all her notes, and none of it was saved anywhere else. Write three things Thandi has lost. Then describe what she could have done before the theft so that she could carry on working the next day on a borrowed computer.
THINK FIRST · no computer needed

2.2Would you trust this shop?

Shop A is a page on social media. It offers a new smartphone for R199, “today only”, and asks you to pay by EFT into a personal bank account and to WhatsApp the seller. Shop B is a website that shows a padlock, a street address, a phone number, a return policy and a tracking number for deliveries, and sends a PIN to your phone to approve the card payment. Which would you trust, and what differences made you decide?
LEARN IT

Online storage, synchronisation and collaboration

Online storage (cloud storage) means saving your files on a company's servers instead of only on your own device, and reaching them through the internet with a username and password. Google Drive, OneDrive and Dropbox are examples. You can open your files on any device, and the files survive if your phone is lost or broken, so it works like a backup. The disadvantages are that you need internet (data costs, and the router goes off during load shedding), the free space can run out, and you must trust a company with your private files.

Synchronising means that the copies of a file on your devices and in the cloud are kept identical. A change on one device goes to the cloud when the device is online, and the cloud passes it on to your other devices. If you edit offline, the change waits on that device until the connection returns. Syncing saves copying by hand, but it needs internet and uses data.

Online collaboration means several people work on the same file at the same time from different places. They see each other's changes, leave comments and use the version history to undo mistakes. The owner gives each person a permission: view, comment or edit. It removes the confusion of many copies, but it needs a good connection and careful sharing so that private files do not reach the wrong people.
LEARN IT

Online shopping and social media

Online shopping lets you compare prices, buy at any hour and have goods delivered, which helps people in small towns far from big shops. The risks are fake shops, phishing emails that pretend to be your bank, stolen card details and goods that are not as advertised. Safe shoppers use known websites that show https and a padlock, pay with a method that has extra protection such as a card with a one-time PIN, read reviews, check the return policy and ignore deals that are too good to be true.

Social media lets you stay in touch, share news and find communities. The risks are cyberbullying, strangers who are not who they say they are, fake news, spending too much time scrolling, and your digital footprint: what you post can be copied and can stay online for years. Keep your profile private, think before you post, never share your ID number or address, and tell an adult if something worries you. The law called POPIA protects personal information, and it is one more reason not to give your details to anyone who does not need them.
LEARN IT

Write in sentences, not lists

In a written answer, the marker reads every sentence of a paragraph, but may stop crediting a list after the first few bullets. Build each answer from three parts: a point (what), an explanation (why or how), and an example from real life. Put them in a paragraph and join them with words such as because, so and for example.

Question: Explain one risk of social media.
Model answer: “One risk of social media is that what you post can stay online for years. This is called your digital footprint, and it means a photo or joke that you delete can still have been copied and shared by others. For example, a learner who posts an embarrassing photo in school uniform may find that a future employer sees it. To reduce this risk, learners should keep their profiles private and think before they post.”

2.3Key words [5]

Saving files on a company's servers and reaching them through the internet is (cloud) storage. Keeping every copy of a file identical on all devices is . Several people editing the same file at the same time is . A person's trail of posts and photos on the internet is their digital . The address of a safe shopping website begins with .

2.4Which service is it? [6]

Circle the service that each situation describes best.

1Mpho saves her Maths project on a provider's servers so that she can open it at school or at home.Storage  Sync  Collaborate
2Her phone, tablet and laptop all show the newest version of her timetable, without her copying anything by hand.Storage  Sync  Collaborate
3Three learners type into the same presentation at the same time and leave comments for each other.Storage  Sync  Collaborate
4Dad uploads 40 holiday photos so that they are safe if the laptop is stolen.Storage  Sync  Collaborate
5When the Wi-Fi comes back after load shedding, her offline edits appear on every device.Storage  Sync  Collaborate
6The teacher shares a document and decides that learners may comment but not edit.Storage  Sync  Collaborate

2.5Follow the file [6]

Everything starts as version 1 (v1) on the laptop, the phone and in the cloud. Complete what each place holds after every event.

EventLaptopPhoneCloud
1. The phone is switched off. Thandi edits the report on the laptop, online.
2. The phone is switched on and connects to the internet.
3. Load shedding: the router is off. She edits the report again on the laptop.
4. Power returns and the laptop reconnects.

2.6Safe sign or warning sign? [6]

Circle what each clue tells you about an online shop.

1The address begins with https and shows a padlock.Safe sign  Warning
2The seller accepts payment only by EFT into a personal bank account.Safe sign  Warning
3The site shows a street address, a phone number and a clear return policy.Safe sign  Warning
4A famous laptop for R1 500, with a countdown clock saying “2 minutes left”.Safe sign  Warning
5Your bank sends a one-time PIN to your phone to approve the payment.Safe sign  Warning
6An email says your parcel is held and asks you to click a link and type your card number.Safe sign  Warning

2.7Take the model answer apart [3]

Look at the model answer in Write in sentences, not lists. Copy the sentence that makes the point, the sentence that gives the example, and the sentence that says how to reduce the risk.

2.8Turn the list into a paragraph [3]

A learner answered the question Explain why cloud storage is useful for a learner like this: “- anywhere - safe - backup”. Rewrite the answer as a short paragraph of 2 or 3 full sentences.

2.9Discuss: one risk of social media [4]

Write a paragraph of 3 or 4 sentences. Start with: One risk of social media is…. Include a point, an explanation, an example and how the risk can be reduced.

2.10Discuss: online shopping [4]

A family in a small town far from the nearest big shop decides to buy mostly online. In a paragraph, discuss one advantage and one risk for the family.

How did I do with this unit? I got it   Nearly there   I need help
One thing I want to ask my teacher:

UNIT 3Revision workout: practical

Time to bring Terms 1 to 3 together: operators, IF and CASE, Boolean logic, loops, strings and number algorithms. Do this unit like a mini exam: pencil, no computer, and show every step.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

3.1The taxi marshal's rules

At the rank the marshal charges: children under 5 ride free, children from 5 to 12 pay R10 and everybody else pays R20. Write his rules as short English steps, in the order he must check them. Does the order matter? Would a CASE statement or an IF statement suit these rules better, and why?
LEARN IT

Your toolbox

Choose the tool by asking what the problem needs.
The problem needs…UseRemember
A choice by condition or rangeIF … THEN … ELSEBrackets round each AND / OR condition; no ; before ELSE
A choice by exact valueCASE … OFRanges like 1..5; ELSE catches the rest
A known number of repeatsFORto counts up, downto counts down
Unknown repeats; may be zeroWHILEChange something inside the loop
Unknown repeats; at least oneREPEAT … UNTILStops when the condition is True
Whole part / remainderDIV / MOD17 DIV 5 = 3 and 17 MOD 5 = 2
Every character of a stringFOR + s[i]Positions start at 1
LEARN IT

Four patterns that keep coming back

A running total (start at 0), a counter (start at 0, then Inc), a flag (start True or False, change it when you find the answer) and highest so far.
Delphi
iTotal := 0;                  // running total
for i := 1 to 5 do
  iTotal := iTotal + i;

bFound := False;              // flag: assume No
for i := 1 to Length(sWord) do
  if sWord[i] = 'Z' then
    bFound := True;           // change it when found

3.2What does it give? [7]

Circle the correct value.

117 DIV 52  3  3.4
217 MOD 52  3  3.4
3Trunc(8.9)8  9  8.9
4Sqr(6)12  36  2.45
5Length('Mzansi')5  6  7
6Ord('C')65  66  67
7Chr(Ord('A') + 4)D  E  F

3.3Boolean workout [6]

Given bRain = True, bCold = False and iTemp = 12, write True or False for each expression.

ExpressionTrue or False?
bRain and bCold
bRain or bCold
not bRain
(iTemp < 15) and bRain
not (bCold or (iTemp > 20))
(iTemp mod 5 = 2) and (not bCold)

3.4Be the computer: WHILE [5]

Trace this code. For each check write whether the condition is True, then the values after the body. The last row is the check that stops the loop.

Delphi
iNum := 4086;
iSum := 0;
while iNum > 0 do
begin
  iSum := iSum + iNum mod 10;
  iNum := iNum div 10;
end;
CheckiNum > 0 ?iSumiNum
1
2
3
4
5

3.5What does it do? [2]

In one sentence, say what the loop above calculates, and give the value of iSum.

3.6Predict: strings [3]

What does lblOut show? Describe in one sentence what the code does.

Delphi
sIn := 'Cape Town';
sOut := '';
for i := 1 to Length(sIn) do
  if sIn[i] in ['a'..'z'] then
    sOut := sOut + Chr(Ord(sIn[i]) - 32)
  else
    sOut := sOut + '-';
lblOut.Caption := sOut;

3.7Predict: a prime test [3]

What are the final values of bPrime and iDiv? Trace carefully: when does the loop stop?

Delphi
iNum := 21;
bPrime := True;
iDiv := 2;
while (iDiv < iNum) and bPrime do
begin
  if iNum mod iDiv = 0 then
    bPrime := False;
  Inc(iDiv);
end;

3.8Debug: the senior learner [3]

This code should say whether the age in edtAge is from 14 to 19. Find three errors.

Delphi
var
  iAge : Integer;
begin
  iAge := StrToInt(edtAge.Text);
  if iAge >= 14 and iAge <= 19 then
    lblOut.Caption = 'In range'
  else
    lblOut.Caption := 'Out of range'
  ShowMessage('Checked');
end;

3.9Write it: bus fares [5]

A route number from 1 to 4 is chosen in sedRoute. Use a CASE statement to show the fare in lblFare: route 1 costs R12, route 2 costs R15, routes 3 and 4 cost R22. Any other route must show No such route.

3.10Write it: palindromes [6]

A palindrome reads the same forwards and backwards (MADAM, LEVEL). The word is in sWord. Using a loop and a Boolean flag, show Palindrome or Not a palindrome in lblOut. Compare the first letter with the last, the second with the second last, and so on.

How did I do with this unit? I got it   Nearly there   I need help
One thing I want to ask my teacher:

UNIT 4Revision workout: theory on paper

Paper 2 tests what you understand about computers: number systems, data storage, hardware, networks, security and the law. This unit checks the whole year, one topic at a time.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

4.1Three light switches

A passage has three light switches, each either UP or DOWN. List every different pattern of the three switches (write U for up and D for down, for example UUD). How many patterns are there? How many would there be with 4 switches? With 8 switches? What happens to the number each time you add a switch?
THINK FIRST · no computer needed

4.2Guarding the school

A school protects itself in several ways: a guard at the gate checks everyone who enters or leaves; the nurse checks learners for infections; learners' report records are locked in the office; and a generator switches on when the power fails. Which security tool of a computer matches each of these four? Write a sentence for each.
LEARN IT

Conversion toolbox

Binary → decimal: write the place values 128, 64, 32, 16, 8, 4, 2, 1 above the bits and add the values where the bit is 1. Example: 01101001 = 64 + 32 + 8 + 1 = 105.
Decimal → binary: divide by 2 again and again, write down each remainder, then read the remainders from the bottom up. Example: 53 gives remainders 1, 0, 1, 0, 1, 1, so 53 = 110101 (00110101 in 8 bits).
Hex → decimal: multiply the left digit by 16 and add the right digit (A = 10, B = 11 … F = 15). Example: 7C = 7 × 16 + 12 = 124.
Decimal → hex: divide by 16 and read the remainders from the bottom up. Example: 175 = 10 × 16 + 15 = AF.
Binary ↔ hex: one hex digit is exactly four bits. Example: 1011 0110 = B6.
ASCII gives every character a number: A = 65, a = 97 (32 more), 0 = 48. Unicode has room for thousands of characters, such as isiZulu letters and emoji, which ASCII cannot hold.
LEARN IT

Storage units and the revision map

1 byte = 8 bits · 1 KB = 1 024 bytes · 1 MB = 1 024 KB · 1 GB = 1 024 MB · 1 TB = 1 024 GB. To change to a smaller unit multiply by 1 024; to change to a bigger unit divide by 1 024.
TopicRemember
HardwareInput (keyboard, mouse, scanner, microphone), output (monitor, printer, speakers, projector), processing (CPU), memory (RAM, temporary), storage (HDD, SSD, flash drive), communication (NIC, router, modem).
NetworksPAN (about arm's reach), HAN (one home), LAN (one building, such as a school lab), WAN (cities and countries; the internet). Client-server has a central server; peer-to-peer has equal computers.
SecurityVirus (needs a file to be opened), worm (spreads by itself), trojan (pretends to be useful), ransomware (locks files for payment), spyware (spies), phishing (fake messages). Antivirus removes malware; firewall filters network traffic; UPS survives power cuts.
POPIAThe law that protects personal information. An organisation must collect only what it needs, ask for permission, use it for the stated purpose, keep it safe and let people see and correct their data.

4.3Binary and decimal [8]

Convert as asked. The binary answers must have 8 bits. Write the place values above the bits if it helps.

ConvertAnswer
00001101 (binary) to decimal
00101010 (binary) to decimal
10010110 (binary) to decimal
11111111 (binary) to decimal
19 (decimal) to binary
64 (decimal) to binary
100 (decimal) to binary
205 (decimal) to binary

4.4Show your working

Use the space to show the repeated division by 2 for 205. Write each division with its remainder, then circle the remainders in the order you must read them.

4.5Hexadecimal [6]

Write the answer. Remember A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

ConvertAnswer
3C (hex) to decimal
B5 (hex) to decimal
175 (decimal) to hex
250 (decimal) to hex
11010111 (binary) to hex
5E (hex) to 8-bit binary

4.6Quick-fire: ASCII and storage [12]

If Ord('A') = 65, then Ord('H') = , Chr(81) = , Ord('a') = and the digit '7' has the code . The letter C has code 67, which is in 8-bit binary. The codes 76 79 65 68 spell .
1 KB = bytes.   3 MB = KB.   2 048 MB = GB.   1 byte = bits.   1 TB = GB. A 16 GB memory card can hold photos of 4 MB each.

4.7Hardware match-up [8]

Choose the device from the word bank and write it next to its description.
Word bank: barcode scanner · CPU · microphone · NIC · projector · RAM · router · SSD

DescriptionDevice
Carries out the instructions of a program
Fast flash storage with no moving parts
Temporary memory for programs and data in use; emptied when the power goes off
Connects a LAN to the internet and directs data using IP addresses
Reads black and white stripes at the till
The card that lets a computer connect to a network
Shows a computer's screen on the classroom wall
Changes sound waves into digital data

4.8Which type of network? [5]

Circle PAN, HAN, LAN or WAN.

1Bluetooth earphones paired with a phonePAN  HAN  LAN  WAN
2All the devices on the Wi-Fi in one family homePAN  HAN  LAN  WAN
3The computers in a school labPAN  HAN  LAN  WAN
4A bank linking its branches in Cape Town and DurbanPAN  HAN  LAN  WAN
5A smartwatch linked to a phonePAN  HAN  LAN  WAN

4.9Name the threat [6]

Write the word from the word bank that matches each description.
Word bank: phishing · ransomware · spyware · trojan · virus · worm

DescriptionThreat
Attaches itself to a file and spreads when someone opens that file
Spreads across a network by itself, without anyone opening a file
Looks like a useful program, but secretly lets an attacker in
Locks your files and demands money to unlock them
Secretly records what you type and the sites you visit
A fake message that tricks you into typing your password on a false website

4.10Which protection? [5]

Circle the security measure that solves each problem.

1A program tries to send your files out to the internet.UPS  Firewall  Encryption
2A downloaded game hides a virus.Antivirus  Access rights  UPS
3Load shedding switches the PC off mid-save.UPS  Firewall  Antivirus
4A stolen laptop's files must stay unreadable.Encryption  UPS  Firewall
5Learners may open only their own folders.Antivirus  Access rights  UPS

4.11POPIA in a paragraph [4]

A gym collects its members' ID numbers, cell numbers and home addresses. In a short paragraph, explain two things that POPIA requires the gym to do with this information.

How did I do with this unit? I got it   Nearly there   I need help
One thing I want to ask my teacher:

UNIT 5Exam skills

Knowing the work is only half of it. Learners also lose marks by misreading the question, writing too little (or too much), skipping their working and running out of time. This unit trains the habits that protect your marks.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

5.1Follow the instructions exactly

Read every instruction before you do anything.
1. Write today's date at the top right of this box.   2. Draw a circle around the number of this question.   3. Write the numbers 1 to 5 in a row. 4. Underline the third number.   5. Now that you have read everything, ignore steps 2 to 4 and just write your first name below the date.
LEARN IT

Read, count, answer

1. Read the whole question and underline the command word. 2. Count the marks: in most theory questions each mark is one separate, correct point, so [2] means two points and [4] means four. 3. Answer only what is asked: no essay for one mark, and no one-word answer for four marks. 4. Check that you have given as many points as there are marks.
LEARN IT

Plan your code, show your working

Before you write code, plan it: list the inputs, the process and the outputs, then write the steps in plain English, then the Delphi. Name your variables and write comments so a marker can follow your thinking. In traces and calculations, show your working: a marker can give marks for a correct method even if the final answer is wrong, but a bare wrong answer earns nothing. In a paper of 60 marks in 90 minutes you have about 1.5 minutes per mark, so a 6-mark question should take about 9 minutes. Leave 5 to 10 minutes to check at the end.
LEARN IT

Command words

Command wordWhat you must doHow much to write
Give / Name / State / ListWrite the answer only.A word, a short phrase or one sentence.
DefineSay exactly what the term means.One clear sentence.
ExplainSay what it is and why or how.One point and its reason for each mark.
DescribeSay what it looks like or how it works.A few connected sentences.
DiscussGive several points (often advantages and disadvantages) and explain each one.A paragraph; every point explained.
Motivate / JustifyChoose, and then give reasons for your choice.The choice plus explained reasons.
Differentiate / CompareShow how two things are alike or different.Both items mentioned in each point.
CalculateWork it out and show the steps.Formula, working, answer with unit.

5.2Mark the answers [3]

The question is: Explain how a firewall protects a computer. [2] Three learners answered. A: “It protects it.”   B: “A firewall checks all the data coming into and going out of the computer. It blocks traffic that is not allowed, such as a hacker trying to connect.”   C: “firewall, security, blocks”. Give each answer a mark out of 2 and say why.

5.3Answer to the mark allocation [6]

Answer each question with the right amount of detail.
(a) Give one example of an online storage service. [1]
(b) Explain why you should log out of a shared computer. [2]
(c) Motivate whether a school should buy SSDs or HDDs for its computer lab. [3]

5.4Plan it first [3]

A taxi carries 15 passengers. The number of people waiting is typed in edtWaiting. The program must show how many full taxis can leave and how many people are left over. Draw a small table with three headings: Input, Process, Output, and fill it in. Do not write Delphi yet.

5.5Now write the code [5]

Using your plan, write the Delphi code. Declare your variables.

5.6Show your working [3]

Each photo on Thandi's phone is about 300 KB. She has 45 photos. How many MB do they take up in total? Give the answer correct to 2 decimal places and show your working.

How did I do with this unit? I got it   Nearly there   I need help
One thing I want to ask my teacher:

TERM CHECKPOINTFiles, internet and revision

Time: 90 minutes
Total: 60 marks
Mark: ______ / 60

No notes, no computer. Show all your working. Write Delphi code neatly and use correct indentation.

SECTION A — Trace and predict [11]

A1 [5]

Marks.txt contains four lines of text: 62, 48, 75 and 50. Complete the table for every check of the loop. The last row is the check that ends the loop.

Delphi
iPass := 0;
AssignFile(tFile, 'Marks.txt');
Reset(tFile);
while not EOF(tFile) do
begin
  ReadLn(tFile, sLine);
  iMark := StrToInt(sLine);
  if iMark >= 50 then
    Inc(iPass);
end;
CloseFile(tFile);
CheckEOF(tFile)iMarkiPass
1
2
3
4
5

A2 [3]

What does lblOut show? Describe in one sentence what the code does.

Delphi
sIn := 'HAL';
sOut := '';
for i := 1 to Length(sIn) do
  sOut := sOut + Chr(Ord(sIn[i]) + 1);
lblOut.Caption := sOut;

A3 [3]

List the lines that are in Count.txt after this code has run.

Delphi
AssignFile(tFile, 'Count.txt');
Rewrite(tFile);
for i := 1 to 3 do
  WriteLn(tFile, IntToStr(i * 10));
CloseFile(tFile);
AssignFile(tFile, 'Count.txt');
Append(tFile);
WriteLn(tFile, 'Done');
CloseFile(tFile);

SECTION B — Find the errors [6]

B1 [3]

This code should create a brand-new file Scores.txt that contains one line: the name and score typed in edtName and edtScore. Find and correct three errors.

Delphi
AssignFile(tFile, 'Scores.txt');
Append(tFile);
WriteLn(edtName.Text + ' ' + edtScore.Text);
CloseFile('Scores.txt');

B2 [3]

This code should count the multiples of 3 from 1 to 20 and display the count. Find and correct three errors.

Delphi
iNum := 1;
while iNum <= 20 do
begin
  if iNum mod 3 = 0 then
    Inc(iCount);
end;
lblOut.Caption := iCount;

SECTION C — Write the code [18]

C1 [8]

Temps.txt holds the maximum temperature of each day in whole degrees, one value on each line (all above 0). Write code that reads the file and displays in lblAvg the average temperature and in lblMax the highest temperature. (Variables tFile, sLine, iTemp, iTotal, iCount, iMax and rAverage are declared.)

C2 [5]

Write code that creates a new file Evens.txt and writes in it all the even numbers from 2 to 20, one number on each line.

C3 [5]

A sentence is stored in sSentence. Build a new string in which every vowel (A, E, I, O, U, in capitals or small letters) is replaced by a star (*). All other characters stay the same. Display the new string in lblOut.

SECTION D — Theory [25]

D1 [6]

Show your working in the margin. Convert as asked.

ConvertAnswer
00110101 (binary) to decimal
78 (decimal) to 8-bit binary
9B (hex) to decimal
90 (decimal) to hex
11100010 (binary) to hex
The ASCII code of the letter M, if A = 65

D2 [3]

5 MB = KB.   1 TB = GB.   A 32 GB flash drive can store songs of 8 MB each.

D3 [4]

Circle whether each device is an input device, an output device or a storage device.

1Barcode scannerInput  Output  Storage
2ProjectorInput  Output  Storage
3SSDInput  Output  Storage
4SpeakersInput  Output  Storage

D4 [3]

Circle the type of network.

1A smartphone connected to a Bluetooth speakerPAN  LAN  WAN
2The computers in a school computer labPAN  LAN  WAN
3The internetPAN  LAN  WAN

D5 [2]

Explain the difference between a firewall and antivirus software.

D6 [3]

Thandi uses a phone at home and a computer at school. Explain how online storage and synchronisation help her to carry on working on the same project on both devices.

D7 [4]

Discuss two risks of using social media and how a learner can protect themselves from each.

COMING UP NEXT TERM · warm-up

A row of school lockers

Next term you will store many values at once. Think about a corridor of 30 numbered lockers, one for each learner in a class. Each locker holds one thing: that learner's mark. You never have to give a locker its own name; you simply say “locker 17”.

(a) Suppose you had to remember 30 marks, but the only tool you had was a separate, differently named box for each mark (Mark1, Mark2, Mark3, …). How would you feel about writing out all 30 names? What about 300?
(b) How would a numbered row of lockers make it quick to add up all 30 marks, or to find the highest one?
(c) What happens if someone asks for locker 31?