Computing
Step into a digital world.....

J277 26: Exam Rehearsal

OCR GCSE COMPUTER SCIENCE · J277 · PAPERS 1 + 2

Exam rehearsal

Read the question, use the marks, show your working. The final lesson of the course.

Papers 1 + 2 · Lesson 26

1 / 25
volgende
Slide 1: Slide
newEditorComputer ScienceUpper Secondary (Key Stage 4)GCSE

In deze les zitten 25 slides, met interactieve quizzen en tekstslides.

time-iconLesduur is: 60 min
Dit is niet oké

Introductie

OCR GCSE Computer Science (J277), Papers 1 and 2, lesson 26 of 26 (Block D, the final lesson). Students rehearse exam technique for J277/01 Computer systems and J277/02 Computational thinking, algorithms and programming: command words and marks, calculations with working shown, explanations in context, an 8-mark discuss question marked in levels, tracing code, and writing a Section B algorithm in OCR Exam Reference Language or Python. Activities include a do now on lesson 25, a mixed retrieval quiz across the whole course, a drag-and-drop, a spot-the-mistake task, a sorting question, fill in the blanks and an exam-style question with a model answer. This lesson was created with AI assistance.

Onderdelen in deze les

OCR GCSE COMPUTER SCIENCE · J277 · PAPERS 1 + 2

Exam rehearsal

Read the question, use the marks, show your working. The final lesson of the course.

Papers 1 + 2 · Lesson 26

Lesson 26 of 26, the last lesson of the J277 series (Block D): exam rehearsal for both papers. J277/01 Computer systems covers sections 1.1 to 1.6; J277/02 Computational thinking, algorithms and programming covers sections 2.1 to 2.5. Each paper is 1 hour 30 minutes, 80 marks and 50% of the GCSE.

Cover photo: William Warby / Unsplash (a stopwatch: today is about using the time in the exam well).

Device-free: show the slide; pupils write the title and date. Image credit: William Warby / Unsplash (cover hologram)

00 · MISSION · BY THE END OF THIS LESSON

By the end of this lesson you can…

01  Use the command word and the marks to plan what an answer needs.

02  Answer Paper 1 calculations, explanations and an 8-mark discuss question.

03  Trace code and write a Paper 2 algorithm in ERL or Python.

Read the three outcomes. Today is not new content: it is how to turn what pupils know into marks, with practice across the whole course (Paper 1 sections 1.1 to 1.6 and Paper 2 sections 2.1 to 2.5).

Device-free: pupils copy the outcomes and tick each one at the end.

02 · CHECK · DO NOW (LESSON 25)

Warm up: subprograms, SQL and files

1  What is the difference between a procedure and a function?

2  What does return do?

3  What do SELECT, FROM and WHERE do in SQL?

4  What is endOfFile() for?

▮ TERMINAL // do_now_answers

1  a function returns a value;

   a procedure does not

2  hands a value back to

   where it was called

3  fields · table · condition

4  True when no lines are left:

   it stops a read loop

Retrieval from lesson 25. Give 4 minutes, then click to reveal the answers line by line.

1 A function returns a value (so it can be stored, as in a = area(3, 4)); a procedure does a job but returns nothing. 2 return hands a value back to the place where the function was called, and ends the function. 3 SELECT names the fields to show, FROM names the table, WHERE gives the condition the records must meet. 4 endOfFile() is True when there are no more lines to read, so while NOT myFile.endOfFile() keeps reading until the file is finished.

Exam link: "state the difference" questions like 1 are worth 1 or 2 marks, and the answer must mention BOTH things being compared.

Device-free: questions on the board; mini whiteboards.

Recap. The table Pupils has the fields Name, Form, Age and House. Write an SQL query to show the Name of every pupil in the Blue house.

Interactive recap of lesson 25. Give 2 minutes.

Model answer: SELECT Name FROM Pupils WHERE House = 'Blue'. With the lesson 25 table this returns Callum and Yusuf. Single or double quote marks around Blue are both fine; a number would not need quote marks.

Common mistakes: SELECT * (shows every field, not just Name), leaving out FROM Pupils, or writing WHERE Blue without the field name.

Device-free: pupils write the query on mini whiteboards.

01 · LEARN · MISSION BRIEFING

Two papers, one plan

Each paper: 1 h 30 min · 80 marks · 50% of the GCSE.

PAPER 1 · J277/01

Computer systems (1.1 to 1.6): hardware, data, networks, security, software, impacts.

PAPER 2 · J277/02

Computational thinking, algorithms and programming (2.1 to 2.5).

SECTION B

Paper 2 Section B focuses on programming. Answer in ERL or a language such as Python.

SYSTEM VOICE

System online. Final mission: exam rehearsal. Read every question twice, find the command word, check the marks, and show your working. Two papers, 80 marks each, 90 minutes each. Let's finish strong.

Click play for the system voice briefing. The words are also on the slide.

The two J277 papers: J277/01 Computer systems (sections 1.1 to 1.6: systems architecture, memory and storage, networks, network security, systems software, and ethical, legal, cultural and environmental impacts) and J277/02 Computational thinking, algorithms and programming (sections 2.1 to 2.5: algorithms, programming fundamentals, producing robust programs, Boolean logic, languages and IDEs). Each paper is 1 hour 30 minutes, 80 marks and 50% of the GCSE.

Paper 2 has two sections. Section B focuses on programming: questions ask pupils to write, refine or follow code, and answers may be given in OCR Exam Reference Language (ERL) or a high-level language such as Python. Check the front of the current paper for the exact instructions.

Device-free: pupils write the two paper titles and one topic from each.

01 · LEARN · COMMAND WORDS

The command word tells you what to write

STATE / IDENTIFY

A short fact. No reason needed.

State one input device. Keyboard.

DESCRIBE

Say what it is or what happens, step by step.

Describe the fetch stage of the cycle.

EXPLAIN

A point plus a reason: because… so…

Explain why cache speeds up the CPU.

COMPARE

How two things are alike or different. Mention both.

Compare RAM and ROM.

DISCUSS

Weigh up both sides, then conclude. Often 8 marks.

Discuss the impacts of self-driving cars.

WRITE / REFINE

Write an algorithm, or improve given code so it works.

Refine the code to validate the input.

The command word is the first word of the question, and it decides the kind of answer that scores.

State or identify: a short fact; no explanation is needed (State one input device: keyboard). Describe: say what something is or what happens, in order (in the fetch stage the address in the PC is copied to the MAR, the instruction is fetched from memory into the MDR and the PC is incremented). Explain: a point PLUS a reason, with because or so (cache is faster memory close to the CPU, so frequently used instructions and data can be fetched more quickly than from RAM). Compare: say how BOTH things are alike or different (RAM is volatile but ROM is non-volatile). Discuss: weigh up both sides and reach a conclusion; these are usually the 8-mark extended questions marked in levels. Write or refine: produce working code or pseudocode, or improve code you are given (for example, add validation).

Device-free: pupils write the six command words and one example question for each.

01 · LEARN · MARKS = POINTS

One mark, one point, in the question's context

[1 mark] State one reason the school's laptops run slowly.

Not enough RAM.

[2 marks] Explain how more RAM could make the laptops faster.

More programs and data fit in RAM at once (1), so less virtual memory is used and the CPU waits less for slow storage (1).

SYSTEM VOICE · KEY DEFINITION

Key definition. A command word tells you what kind of answer the examiner wants. State means give a short fact. Explain means give a point and a reason why. The marks tell you how many points to make.

The same topic at two mark values. Ask pupils to answer the 2-mark question before clicking to reveal the model answer.

1 mark: one short fact is enough. 2 marks: two separate creditworthy points, here a point and the reason it helps. Each (1) shows where a mark is earned. When RAM is full, the operating system uses virtual memory on secondary storage, which is much slower; more RAM means less of that swapping.

Use the context: the question is about the school's laptops, so the answer talks about those laptops, not computers in general. Generic answers often lose marks in context questions.

Play the key definition. Rule of thumb: count the marks and plan that many points.

Device-free: pupils write a 2-mark answer to "Explain why a smartphone might use flash memory" (it has no moving parts (1), so it is not damaged when the phone is dropped or carried (1)).

04 · EXAM · PAPER 1 · CALCULATIONS

Show every step of the working

▮ TERMINAL // image_file_size

Q An image is 100 x 50 pixels with a

  colour depth of 8 bits. Calculate

  the file size in KB. [3]

 

1  pixels = 100 x 50 = 5000

2  bits   = 5000 x 8 = 40000

3  bytes  = 40000 / 8 = 5000

4  KB     = 5000 / 1000 = 5 KB

MARK SCHEME

1: 100 x 50 x 8

1: divide by 8 for bytes

1: divide by 1000: 5 KB

Working earns marks even if the final answer is wrong.

▮ TERMINAL // binary_to_hex

10110110 -> 1011 | 0110

1011 = 11 = B  0110 = 6

answer: B6

A Paper 1 calculation from Block A (lesson 6). Ask pupils to try it before clicking to reveal the working line by line.

Image file size = width x height x colour depth (in bits). 100 x 50 = 5000 pixels; 5000 x 8 = 40 000 bits; 40 000 / 8 = 5000 bytes; 5000 / 1000 = 5 KB. OCR uses 1 KB = 1000 bytes. Every step is written down: a pupil who slips at the end still gets the method marks, but only if the working is on the paper.

Second click: binary to hexadecimal (lesson 5). Split 10110110 into nibbles: 1011 is 8 + 2 + 1 = 11, which is B in hex; 0110 is 4 + 2 = 6. So the answer is B6 (check: B6 = 11 x 16 + 6 = 182, and 10110110 = 128 + 32 + 16 + 4 + 2 = 182). All values checked twice and in Python 3.

Device-free: pupils work out the size of a 200 x 100 image with colour depth 4 bits (200 x 100 x 4 = 80 000 bits, / 8 = 10 000 bytes, / 1000 = 10 KB).

04 · EXAM · PAPER 1 · EXPLAIN

A point is not enough. Add the reason.

NETWORKS [2] Explain one advantage of a star topology for the school network.

Weak: It is more reliable.

Strong: If one cable or computer fails, the rest of the network keeps working (1) because each device has its own cable to the central switch (1).

SECURITY [2] Explain how a firewall helps protect the school network.

Weak: It stops hackers.

Strong: It checks the data packets coming in and going out (1) and blocks any that break its rules, such as attempts at unauthorised access (1).

Two Paper 1 questions from Block B (lessons 9 and 12). Click to reveal the question, then the weak answer, then the strong answer. Ask pupils why the weak answer loses marks before revealing the strong one.

Star topology: "It is more reliable" is a claim with no reason, so it gets 1 mark at most. The strong answer gives the advantage (the rest of the network keeps working if one cable or device fails) and the reason (each device has its own connection to the central switch). Pupils can add the matching disadvantage if asked: if the central switch fails, the whole network goes down.

Firewall: "It stops hackers" is too vague. The strong answer says what the firewall does (it monitors incoming and outgoing traffic) and how that protects the network (it blocks traffic that does not meet its rules, such as unauthorised access).

Pattern for explain questions: point, then because or so, then the reason, in the context of the question.

Device-free: pupils turn "Encryption keeps data safe" into a 2-mark answer (data is scrambled using a key (1), so if it is intercepted it cannot be understood without the key (1)).

04 · EXAM · THE 8-MARK DISCUSS QUESTION

Discuss: both sides, then a judgement

[8] Discuss the ethical, legal and environmental impacts of a school giving every pupil a tablet instead of paper textbooks.

PLAN

Ethical: learn anywhere, but pupils with no home wifi fall behind.

Legal: pupil data must be kept secure (Data Protection Act 2018); e-books are licensed (copyright).

Environmental: less paper, but e-waste, mining for metals and electricity.

Conclude: weigh it up and decide.

MARKED IN LEVELS

Level 3 (6–8) all areas, both sides, well explained, clear conclusion.

Level 2 (3–5) some points explained; may be one-sided.

Level 1 (1–2) a few points, little explanation.

A list of words stays in Level 1.

The longer Paper 1 questions on section 1.6 (ethical, legal, cultural and environmental impacts) are marked with levels of response, not one mark per point. The examiner reads the whole answer and places it in a level, then a mark within it. In general: Level 3 (6 to 8 marks) is thorough, covers the areas asked for, looks at both sides with developed explanations and reaches a conclusion; Level 2 (3 to 5) has some explained points but may be one-sided or miss an area; Level 1 (1 to 2) has a few basic points with little explanation. Use the mark scheme for the actual paper when marking.

Click to build the plan. Model sentences: Ethical: tablets let pupils learn anywhere and use up-to-date resources; however, pupils without wifi at home may fall behind, which widens the digital divide. Legal: the school stores pupils' personal data on the tablets or in the cloud, so under the Data Protection Act 2018 it must be kept secure; e-books are licensed, so copying them breaks the Copyright, Designs and Patents Act 1988. Environmental: less paper is used and fewer trees are cut down; on the other hand, tablets need metals that are mined, use electricity, and become e-waste when replaced. Conclusion: for example, tablets are a good idea if the school lends wifi devices to pupils who need them and recycles old tablets responsibly.

Every point is a full sentence that says what the impact is and why it matters. Single words such as "cost", "hacking", "pollution" stay in Level 1.

Device-free: pupils write one developed paragraph for one of the three areas, with a however.

01 · LEARN · THE BIG IDEA

Marks live on the page

1  The examiner can only mark what is written.

2  Write every step of a calculation.

3  One clear point for each mark.

4  Cross out neatly; do not scribble.

5  Never leave a gap: a sensible try can score.

Remember: if it is not on the paper, it does not score.

Click to reveal the points. The photo is the idea to remember: a test paper with every answer written out on the page. That page is all the examiner sees. Working that stays in a pupil's head earns nothing; working on the page can earn method marks even when the final answer is wrong.

One clear point per mark: a 3-mark question needs three separate points. If an answer is changed, cross it out with a single line so the examiner knows which answer to mark. A blank space always scores 0, but a sensible attempt (a formula, the first step, a partly correct algorithm) can pick up marks.

Photo: Chris Liverani / Unsplash.

Device-free: pupils write the "Remember" line at the top of their revision notes. Image credit: Chris Liverani / Unsplash

01 · LEARN · PAPER 2 TECHNIQUE

Read code like the computer does

READ IT TWICE

First for what it does, then line by line.

TRACE TABLE

A column per variable and output. A new row for each change.

ERL OR PYTHON

Both are accepted in Section B. Pick one; do not mix.

NEAT CODE

Indent inside loops and ifs. Use names like total, not t.

▮ TERMINAL // trace.erl

1  total = 0

2  for i = 1 to 3

3      total = total + i

4  next i

5  print(total)

 

 i | total | output

 - |   0   |

 1 |   1   |

 2 |   3   |

 3 |   6   |

   |       | 6

Four habits for Paper 2. Read the code twice: once to see what it is for, then line by line as the computer would. Use a trace table: one column for each variable and one for output, and a new row each time a value changes. In Section B, answers may be written in OCR Exam Reference Language or a high-level language such as Python; pick one and stay with it. Neat code: indent the lines inside a loop or an if, and use meaningful variable names.

Click to reveal the code and then the trace table row by row. total starts at 0. In ERL, for i = 1 to 3 includes 3, so the loop runs three times: i = 1, total = 1; i = 2, total = 3; i = 3, total = 6. After the loop, print(total) outputs 6. Checked twice and in Python 3 (for i in range(1, 4), because Python's range stops before the second number).

Common trace mistakes: skipping the starting value, forgetting that ERL's for loop includes the end value, and writing output inside the loop when the print is after it.

Device-free: pupils trace the same code with for i = 2 to 5 (total 2, 5, 9, 14; output 14).

04 · EXAM · PAPER 2 · SECTION B

Worked example: validate, then total

[6] Write an algorithm that takes 5 test scores. Any score outside 0 to 100 must be entered again. Output the total.

▮ TERMINAL // scores.erl

1  total = 0

2  for i = 1 to 5

3    score = int(input("Score: "))

4    while score < 0 OR score > 100

5        score = int(input("0 to 100: "))

6    endwhile

7    total = total + score

8  next i

9  print("Total: " + str(total))

MARK SCHEME

1: loop runs 5 times

1: input cast to integer

1: checks 0 to 100

1: asks again until valid

1: adds to a running total

1: outputs total after loop

A Section B style question, 6 marks. Ask pupils to plan first: which loop for the 5 scores (count-controlled for), which loop for the validation (condition-controlled while, because we do not know how many tries it will take), and where the total goes.

Click to reveal the ERL line by line. Line 1 sets the running total to 0 BEFORE the loop. Line 3 inputs a score and casts it to an integer with int(). Lines 4 to 6 keep asking while the score is out of range (less than 0 OR more than 100). Line 7 adds the valid score to the total. Line 9 outputs the total AFTER the loop, using str() to join it to the text.

Example run: inputs 50, 120 (rejected), 70, -3 (rejected), 80, 100, 0 give Total: 300 (50 + 70 + 80 + 100 + 0). Checked in Python 3 with this version, which is also accepted: total = 0, then for i in range(5): with score = int(input("Score: ")), while score < 0 or score > 100: score = int(input("0 to 100: ")), and total = total + score indented inside, then print("Total: " + str(total)) after the loop.

Typical lost marks: total = 0 inside the loop (it resets every time), using if instead of while (only one re-try), printing the total inside the loop, and AND instead of OR in the range check (a score cannot be both below 0 and above 100, so the check would never be true).

Device-free: pupils write the algorithm on paper, then mark it against the six points.

03 · DEBUG · COMMON MISTAKES

Six mistakes that cost marks every year

RAM OR ROM?

RAM is volatile: programs in use. ROM is non-volatile: boot-up instructions.

MOD OR DIV?

13 MOD 4 = 1 (the remainder).

13 DIV 4 = 3 (whole times).

BINARY SEARCH

Only works on a sorted list. Linear search works on any list.

UNITS

Bits divided by 8 give bytes. OCR uses 1 KB = 1000 bytes.

CAST THE INPUT

input() gives a string. Use int() before you do maths with it.

= OR ==?

= stores a value in a variable. == compares two values.

Go through the six cards; ask pupils which one they have made themselves.

RAM is volatile (contents lost when the power is off) and holds the programs and data currently in use; ROM is non-volatile and holds the instructions needed to start the computer (the BIOS or boot program). MOD gives the remainder and DIV the whole number of times: 13 = 3 x 4 + 1, so 13 MOD 4 = 1 and 13 DIV 4 = 3 (Python: 13 % 4 and 13 // 4, checked). Binary search needs the list sorted first; linear search works on sorted or unsorted lists. Units: divide bits by 8 for bytes, then by 1000 for KB (OCR uses multiples of 1000). input() always returns a string, so "5" + "3" joins to "53"; int(input()) is needed before maths. In ERL and Python, = assigns and == compares.

Device-free: pupils write the one mistake they are most likely to make on a sticky note and put it on their revision notes.

Quiz 1 · Paper 1. Which memory is volatile and holds the programs currently in use?

A

ROM

B

SSD

C

RAM

D

HDD

Mixed retrieval quiz, question 1 (Paper 1, section 1.2). Answer: C, RAM. RAM is volatile (it loses its contents without power) and holds the operating system, programs and data currently in use.

ROM is non-volatile and holds the boot-up instructions. An SSD and an HDD are secondary storage: non-volatile, used to keep files and programs when they are not running.

Photo: Harrison Broadbent / Unsplash (two RAM modules).

Device-free: students hold up A, B, C or D cards. Image credit: Harrison Broadbent / Unsplash

Quiz 2 · Paper 2. If x is 7 and y is 2, what does print(x DIV y + x MOD y) output?

A

4

B

4.5

C

3.5

D

3

Question 2 (Paper 2, section 2.2). Answer: A, 4. 7 DIV 2 = 3 (2 goes into 7 three whole times) and 7 MOD 2 = 1 (the remainder). DIV and MOD are worked out before the +, so 3 + 1 = 4. Checked in Python 3: 7 // 2 + 7 % 2 gives 4.

4.5 uses ordinary division (7 / 2 = 3.5) and then adds the remainder. 3.5 is 7 / 2 alone. 3 is the DIV part only.

Photo: Juanjo Jaramillo / Unsplash.

Device-free: students hold up A, B, C or D cards. Image credit: Juanjo Jaramillo / Unsplash

Quiz 3 · Either paper. Which command word wants a point plus the reason why?

A

State

B

Identify

C

Define

D

Explain

Question 3 (exam technique, both papers). Answer: D, Explain. An explain answer gives a point and then the reason for it (because, so, which means), and a 2-mark explain usually gives one mark for each.

State and identify want a short fact with no reason. Define wants the meaning of a term.

Photo: American Jael / Unsplash (highlighting the command word is the first step of a good exam routine).

Device-free: students hold up A, B, C or D cards. Image credit: American Jael / Unsplash

Which paper tests each topic? Drag each card.

PAPER 1 · COMPUTER SYSTEMS

PAPER 2 · ALGORITHMS AND CODE



SQL with SELECT, FROM and WHERE

The fetch-execute cycle

Star and mesh topologies

Logic gates and truth tables

Trace tables

Lossy and lossless compression

Answers. Paper 1 (J277/01 Computer systems): the fetch-execute cycle (1.1), star and mesh topologies (1.3), lossy and lossless compression (1.2). Paper 2 (J277/02 Computational thinking, algorithms and programming): SQL with SELECT, FROM and WHERE (2.2), logic gates and truth tables (2.4), trace tables (2.1 and 2.3).

The surprise for many pupils: Boolean logic (logic gates and truth tables) is on Paper 2, not Paper 1. Binary, hex and file sizes are Paper 1 (1.2).

Device-free: pupils draw two columns and sort the six topics, then add two more of their own to each.

03 · DEBUG · SPOT THE MISTAKE

One line of Ayesha's working is wrong

▮ TERMINAL // ayesha_sound_file

Q  8000 Hz, bit depth 16, 10 seconds. KB? [3]

1  8000 x 16 x 10

2  = 1280000 bits

3  1280000 / 1000 = 1280 KB

Ayesha answered a 3-mark question. Check each line, then tap the marker.

Tip: check the units at every step: bits, then bytes, then KB.

Give a minute to find the mistake before tapping the marker. The question: a sound is recorded with a sample rate of 8000 Hz and a bit depth of 16 bits for 10 seconds; calculate the file size in KB (lesson 6).

Lines 1 and 2 are correct: sound file size = sample rate x bit depth x duration = 8000 x 16 x 10 = 1 280 000 bits. Line 3 is wrong: Ayesha divided bits straight by 1000. Bits must first be divided by 8 to give bytes: 1 280 000 / 8 = 160 000 bytes, and 160 000 / 1000 = 160 KB. Checked twice and in Python 3.

Marks: Ayesha would still get the method mark for line 1, because the working is shown. This is why working matters.

Device-free: copy the working onto the board; pupils write the wrong line number and the corrected working.

1

Check your answer and working

2

Underline the command word

3

Check how many marks it is worth

4

Plan your points or steps

5

Write your answer

6

Read the whole question carefully

Put the steps of a good exam routine in order.

Correct order: 1 read the whole question carefully (including any context, table or code); 2 underline the command word; 3 check how many marks it is worth; 4 plan your points or steps (one point per mark; for code, which loops and variables); 5 write your answer; 6 check your answer and working (units, spelling of key terms, that code does what was asked).

Steps 2 and 3 together tell pupils what kind of answer and how much to write. Use this routine on every question in the mocks and the real exams.

Device-free: pupils write the six steps on sticky notes and order them on the desk.

Complete the exam tips.

A 4-mark question usually needs four clear points. Explain means give a point and a reason. An 8-mark discuss question is marked in levels. In calculations, always show your working. Follow code line by line with a trace table. In Section B of Paper 2 you may answer in ERL or a high-level language such as Python.

four
Explain
discuss
working
trace
ERL
two
State
guessing

Answers in order: four, Explain, discuss, working, trace, ERL. Distractors: two, State, guessing.

State wants a fact with no reason, so it does not fit the second gap. Two points would only earn 2 of the 4 marks. ERL is OCR Exam Reference Language; Python or another high-level language is also accepted in Section B.

Device-free: paragraph on the board with gaps and the word bank; pupils write the six missing words.

EXAM · Write an algorithm that asks for a password and keeps asking until it is at least 8 characters long, then outputs Accepted. [4 marks]

Exam-style question, 4 marks (Paper 2, Section B style). Give 6 minutes and remind pupils of the routine: command word (write), marks (4, so four things to get right), plan, write, check. Pupils may answer in OCR Exam Reference Language or Python. The model answer is on the next slide.

Mark scheme: 1 mark each. Inputs a password. Uses a loop with a condition on the length being less than 8 (password.length in ERL, len(password) in Python). Asks for the password again inside the loop. Outputs Accepted after the loop.

A do ... until loop is also correct: do, password = input("Password: "), until password.length >= 8, then print("Accepted").

Device-free: pupils answer on paper, then peer-mark with the next slide.

04 · EXAM · MODEL ANSWER

Loop until the input is valid

▮ TERMINAL // password.erl

1  password = input("Password: ")

2  while password.length < 8

3      password = input("Too short: ")

4  endwhile

5  print("Accepted")

 

// Python: while len(password) < 8:

 

> cat  > dragon1  > dragon123

> Accepted

MARK SCHEME

1 mark: input a password

1 mark: loop while length is less than 8

1 mark: ask again inside the loop

1 mark: output Accepted after the loop

Python is also accepted.

Click to reveal the model answer line by line. Line 1 inputs the first password. Line 2 checks its length with .length; while it is shorter than 8 characters, line 3 asks again. When the loop ends the password must be long enough, so line 5 outputs Accepted.

Example run: cat (3 characters, rejected), dragon1 (7, rejected), dragon123 (9, accepted), then Accepted is printed. Checked in Python 3 with the Python version: password = input("Password: "), then while len(password) < 8: with password = input("Too short: ") indented underneath, then print("Accepted").

Common mistakes: using if instead of while (only one more try), <= 8 instead of < 8 (an 8-character password would be rejected), and printing Accepted inside the loop.

Device-free: pupils tick each mark-scheme point on their own answer and correct it in a different colour.

Which paper do you feel readier for?

1

Paper 1: computer systems

2

Paper 2: algorithms and code

3

Both about the same

4

Neither yet

Anonymous exit poll. Use the result to plan revision lessons: if Paper 2 is weaker, set more trace-table and Section B practice; if Paper 1 is weaker, set retrieval quizzes and explain questions from past papers.

Device-free: thumbs up for Paper 1, thumbs sideways for Paper 2.

05 · NEXT · KEEP GOING

Keep going

Isaac Computer Science

Free lessons and quizzes on every topic in the course.

BBC Bitesize

GCSE Computer Science, OCR: revise one topic a day.

OCR past papers

Past papers and mark schemes are on the OCR website. Mark your own answers.

Timing

80 marks in 90 minutes: about 1 mark a minute, leaving 10 minutes to check.

SERIES COMPLETE · 26 of 26. You have covered every topic on both papers. Now practise under timed conditions. Good luck!

Point pupils to the places to practise. Isaac Computer Science and BBC Bitesize are free. OCR publishes past papers, mark schemes and examiners' reports for J277 on its website: pupils should mark their own answers with the mark scheme and read what the examiners say lost marks.

Timing: each paper is 80 marks in 90 minutes. At about 1 mark a minute, the paper takes about 80 minutes and leaves about 10 minutes to check. A 2-mark question deserves about 2 minutes, an 8-mark question about 8 minutes.

This is the last lesson of the 26-lesson J277 series: every section of J277/01 (1.1 to 1.6) and J277/02 (2.1 to 2.5) has been covered. Suggested next step: a full timed past paper for each paper, marked with the OCR mark scheme.

Device-free: pupils write a revision timetable with one Paper 1 and one Paper 2 topic each week.