Year 10 · Computer Science · Summer 2

Databases and the Year 10 mock · Lesson 5 of 5

Revision: Paper 2 topics 7 to 10

Exam practice7.7 Trace tables7.9 Writing and amending algorithms10.3 Expressions and circuits

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

You will learn to

  • Complete a trace table, a pseudocode task, a logic circuit and an SQL query under time.
  • Plan time on Paper 2, leaving enough for the 15-mark scenario question.
  • Evaluate your answers with the mark scheme and record why each mark was lost.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Success criteria

You have got it when you can say:

  • I can finish four types of Paper 2 question in the time set.
  • I can say how many minutes to spend on a 15-mark question.
  • I can sort my lost marks into 'did not know', 'misread' and 'careless'.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Retrieval starter

Questions from before. Write your answers, then show them.

  1. Last lesson

    17 MOD 5 is…

    A 2B 3C 3.4

    A. 2

  2. Last unit

    Which is a low-level language?

    A JavaB Assembly languageC Python

    B. Assembly language

  3. Earlier this year

    A diamond in a flowchart means…

    A A decisionB Input or outputC A process

    A. A decision

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Key words (1 of 7)

Algorithm
A precise, ordered set of steps that solves a problem.
Program development life cycle
The four stages of making a program: analysis, design, coding and testing.
Structure diagram
A top-down diagram that shows how a system is split into sub-systems.
Pseudocode
A structured, code-like way of writing an algorithm that is not tied to one language.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Key words (2 of 7)

Totalling
Adding values into a running total, for example Total ← Total + Value.
Counting
Adding 1 to a counter each time something happens.
Bubble sort
Sorting by comparing neighbouring items and swapping them if they are in the wrong order, pass after pass.
Validation
An automatic check that input data is reasonable and follows set rules.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Key words (3 of 7)

Check digit
An extra digit calculated from the other digits, used to catch typing errors.
Trace table
A table used in a dry run to record the value of each variable as an algorithm runs.
Logic gate
An electronic component that takes one or two inputs and gives one output by a fixed rule.
Truth table
A table that lists every possible input combination and the output for each one.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Key words (4 of 7)

Logic circuit
Two or more logic gates joined together to give one output.
Logic expression
A written description of a circuit using gate names, such as X = A AND NOT B.
NOT
A one-input gate whose output is the opposite of its input; also called an inverter.
AND
A gate whose output is 1 only when both inputs are 1.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Key words (5 of 7)

OR
A gate whose output is 1 when at least one input is 1.
NAND
NOT AND: the output is 0 only when both inputs are 1.
NOR
NOT OR: the output is 1 only when both inputs are 0.
XOR (EOR)
Exclusive OR: the output is 1 when the two inputs are different.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Key words (6 of 7)

Input
A signal going into a gate or circuit, such as a sensor reading of 1 or 0.
Output
The single result signal that comes out of a gate or circuit.
Working column
An extra truth-table column holding the output of one gate inside a circuit.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Key words (7 of 7)

Sum of products
An expression made by AND-ing the inputs of each row with output 1, then OR-ing those groups together.

The explanation · step 1 of 13 · part 1 of 2

What Paper 2 tests

Paper 2 (Algorithms, Programming and Logic) lasts 1 hour 45 minutes. It has 75 marks.

It covers topics 7 to 10. It ends with a 15-mark scenario question, answered in pseudocode or program code.

Question typeHow to get the marks
Trace tableWork one line at a time. Write a value only when it changes. Copy the output exactly.
Write pseudocodeUse the exact comparison the question needs, such as > or >=. Indent inside loops and IFs.
Logic circuitUse the standard gate symbols. Draw the expression as given. Do not simplify it.
SQL queryUse the exact table and field names from the question. One clause per line.

The explanation · step 1 of 13 · part 2 of 2

What Paper 2 tests (continued)

!Watch out

Check the paper length on the current Cambridge 0478 syllabus for the year your pupils sit the exam.

The explanation · step 2 of 13 · part 1 of 2

Plan your time

105 minutes ÷ 75 marks = 1.4 minutes per mark. The same rule as Paper 1.

The scenario question: 15 × 1.4 = 21 minutes. Add a few minutes to plan it first.

★Remember

Leave about 25 minutes for the 15-mark scenario question. Do not spend it all on the early questions.

The explanation · step 2 of 13 · part 2 of 2

Plan your time (continued)

  • Read the scenario. Underline every task it asks for.
  • Write a short plan: inputs, loops, checks, outputs.
  • Then write the code, one task at a time.

The explanation · step 3 of 13 · part 1 of 2

Mark it like an examiner

  1. Swap scripts with a partner, or mark your own in a different colour.
  2. Give one tick for each point in the mark scheme. No tick for 'nearly'.
  3. Write the missing point next to each lost mark.
  4. Sort every lost mark into one group from the table.

The explanation · step 3 of 13 · part 2 of 2

Mark it like an examiner (continued)

Why the mark was lostFix for next time
Did not knowAdd it to the RAG list as red. Revise it.
Misread the questionUnderline the command word and the key numbers before answering.
Careless slipLeave 5 minutes at the end to check trace tables and code.
Ran out of timeUse the 1.4 minutes per mark rule. Move on when stuck.
?Why?

Why sort lost marks?

Each group has a different fix. More revision does not help with careless slips.

7.7 Trace tables · The explanation · step 4 of 13 · part 1 of 2

What a trace table is

A dry run means working through an algorithm by hand, line by line, without a computer.

A trace table records the dry run. It has one column for each variable, and one for the output.

Write a new value in a column only when that variable changes. Move to a new row when the loop goes round again.

?Why?

A dry run lets you check an algorithm before it is coded. It also shows exactly where a logic error happens.

7.7 Trace tables · The explanation · step 4 of 13 · part 2 of 2

What a trace table is (continued)

!Watch out

Do not fill every cell. Cambridge mark schemes usually want a value only where it changes. Copying values down is not wrong but takes time and causes mistakes.

7.9 Writing and amending algorithms · The explanation · step 7 of 13 · part 1 of 3

The 15-mark scenario question: plan first

The last question on Paper 2 is a scenario worth 15 marks. Allow about 30 minutes. You may answer in pseudocode, Python, Visual Basic or Java.

Read the scenario twice. Underline every task. Make a numbered checklist and tick each item as you code it.

Sample scenario: a teacher records three tests for each of 30 students. Each test is out of 50. Names are already in `StudentName[1:30]`.

7.9 Writing and amending algorithms · The explanation · step 7 of 13 · part 2 of 3

The 15-mark scenario question: plan first (continued)

e.g.Example
Tasks in the sample scenario: 1. Input three marks per student and store them in StudentMark[1:30, 1:3]. 2. Validate each mark: 0 to 50. 3. Calculate and store each student's total in StudentTotal[1:30]. 4. Calculate each student's average, rounded to 1 decimal place. 5. Output each name with total and average. 6. Count and output the students with a total of 120 or more (a merit). 7. Output the class average total and the name of the student with the highest total. All inputs and outputs need suitable messages.

7.9 Writing and amending algorithms · The explanation · step 7 of 13 · part 3 of 3

The 15-mark scenario question: plan first (continued)

?Why?

Marks are given for meeting each requirement. A checklist stops you forgetting one, which is the most common way to lose marks here.

The explanation · 8 more steps

More on the lesson page

The lesson page has the rest of the explanation, step by step:

  • Worked dry run
  • Be precise, and amend with care
  • Model answer in pseudocode and Python
  • How the 15 marks are awarded
  • From a statement to an expression
  • From an expression to a circuit
  • From a circuit to an expression
  • From a truth table to an expression

Open the lesson page

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Quick quiz · 1 of 3

A record is…

  1. A The whole table
  2. B One row: everything about one thing
  3. C One column

B. One row: everything about one thing

A field is a column; a record is a row.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Quick quiz · 2 of 3

A good primary key is…

  1. A A date of birth
  2. B A surname
  3. C A unique ID number

C. A unique ID number

Two pupils can share a surname or a birthday. An ID is unique.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Quick quiz · 3 of 3

SELECT Name FROM Pupils WHERE Year = 8 ORDER BY Name; shows…

  1. A All pupils
  2. B Only the first pupil
  3. C Year 8 names in alphabetical order

C. Year 8 names in alphabetical order

WHERE filters the rows; ORDER BY sorts them.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Exit ticket

Answer on paper before you go. Then check.

  1. The data type for 'has paid' (yes or no) is…

    A TextB BooleanC Real

    B. Boolean Boolean holds true or false.

  2. SELECT COUNT(*) FROM Pupils WHERE House = 'Red'; gives…

    A How many pupils are in RedB Their namesC The total score

    A. How many pupils are in Red COUNT gives one number: how many records match.

Year 10 · Computer Science · Databases and the Year 10 mock · Lesson 5 of 5

Homework and the challenge

Homework

The CS 9 quiz; one past paper over the summer, self-marked.

End-of-unit challenge

Year 10 mock: a full Paper 1 or a full Paper 2 (1 hour 45 minutes), marked with the Cambridge mark scheme.