Back to the topic

The mark scheme starts on a new page, so you can print pages one and two for a student and keep the last page yourself. Everything prints in black on white whichever theme you are using.

Key Stage 3 · Y8.2

Computational Thinking

Section A: 10 multiple choice questions, 10 marks. Section B: 5 written questions, 18 marks. Total 28 marks.

Name

Class

Date

Mark  / 28

Section A

Circle the letter of the correct answer. One mark each.

  1. 1What is decomposition?1
    1. ARemoving unnecessary detail
    2. BPutting steps in order
    3. CSpotting similarities between problems
    4. DBreaking a large problem into smaller problems
  2. 2Which flowchart symbol is used for a decision?1
    1. AA diamond
    2. BA parallelogram
    3. CA rounded rectangle
    4. DA rectangle
  3. 3For an age field accepting 11 to 18, which is boundary test data?1
    1. A10 and 11
    2. B"twelve"
    3. C15
    4. D100
  4. 4Noticing that six different shapes all need the same area formula is an example of:1
    1. AAbstraction
    2. BDecomposition
    3. CIteration
    4. DPattern recognition
  5. 5What is pseudocode used for?1
    1. ARunning a program faster
    2. BPlanning the logic of a program before writing real code
    3. CTesting hardware
    4. DCompressing a program
  6. 6A fire escape map leaves out the colour of the walls. This is an example of:1
    1. ADecomposition
    2. BDebugging
    3. CPattern recognition
    4. DAbstraction
  7. 7What does a trace table show?1
    1. AWhich flowchart symbols to use
    2. BThe value of each variable at each step of an algorithm
    3. CThe time a program takes to run
    4. DThe layout of the user interface
  8. 8Which is erroneous test data for a field that accepts a whole number between 1 and 10?1
    1. A10
    2. B5
    3. C"seven"
    4. D1
  9. 9How many exits does a decision diamond have?1
    1. AThree
    2. BIt depends on the question
    3. CTwo
    4. DOne
  10. 10Why plan an algorithm before writing code?1
    1. ALogic mistakes are much cheaper to fix on paper than in code
    2. BThe teacher requires it
    3. CIt reduces the file size
    4. DPlanning makes the program run faster

Section B

Answer in the space provided. The number of marks tells you how many separate points to make.

  1. 1StateState what is meant by decomposition and abstraction.2
  2. 2DescribeA school wants a program to record how many students take a packed lunch each day. Describe how decomposition could be used to plan this program.4
  3. 3CompleteComplete a trace table for this algorithm: total = 0, then for i = 1 to 4, total = total + (i * 2), next i. State the final value of total.4
  4. 4DescribeDescribe the purpose of the diamond and the parallelogram symbols in a flowchart.2
  5. 5GiveA program accepts a mark between 0 and 100. Give one example each of normal, boundary and erroneous test data, and explain what each tests.6

Mark scheme

Section A

1D2A3A4D5B6D7B8C9C10A

Section B

1 State what is meant by decomposition and abstraction. 2

One mark for each of the following, to a maximum of 2.

  • Decomposition is breaking a problem into smaller parts
  • Abstraction is removing detail that is not needed

Model answer. Decomposition means breaking a large, complex problem down into smaller sub problems, each of which is easier to understand and solve on its own. Abstraction means removing or hiding detail that is not relevant to the problem you are solving, so that you can concentrate only on what actually matters.

2 A school wants a program to record how many students take a packed lunch each day. Describe how decomposition could be used to plan this program. 4

One mark for each of the following, to a maximum of 4.

  • The problem is broken into smaller sub problems
  • First sub problem such as entering the class name or date
  • Second sub problem such as counting or storing the numbers
  • Third sub problem such as displaying or saving a report

Model answer. The overall problem would be broken into several smaller sub problems that can each be solved separately. One sub problem is collecting the input: asking for the date and the class, and entering how many students in that class have a packed lunch. A second is validating and storing that data, checking the number entered is sensible and saving it so it is still there tomorrow. A third is calculating totals, adding up the numbers across all the classes to get a daily figure. A fourth is producing output, displaying the daily total on screen and perhaps saving a weekly summary to a file. Each of these parts is small enough to write and test on its own, and they can then be joined together into the finished program.

3 Complete a trace table for this algorithm: total = 0, then for i = 1 to 4, total = total + (i * 2), next i. State the final value of total. 4

One mark for each of the following, to a maximum of 4.

  • After i = 1 total is 2
  • After i = 2 total is 6
  • After i = 3 total is 12
  • Final value of total is 20

Model answer. When i is 1, i times 2 is 2, so total becomes 0 plus 2 which is 2. When i is 2, i times 2 is 4, so total becomes 2 plus 4 which is 6. When i is 3, i times 2 is 6, so total becomes 6 plus 6 which is 12. When i is 4, i times 2 is 8, so total becomes 12 plus 8 which is 20. The final value of total is therefore 20.

4 Describe the purpose of the diamond and the parallelogram symbols in a flowchart. 2

One mark for each of the following, to a maximum of 2.

  • The diamond represents a decision with two labelled branches
  • The parallelogram represents input or output

Model answer. The diamond represents a decision. It contains a question with a true or false answer and always has exactly two exits, one labelled Yes and one labelled No, so the flow of the algorithm splits depending on the answer. The parallelogram represents input or output, meaning either data being entered into the system, such as a user typing a number, or results being displayed, such as a message shown on screen.

5 A program accepts a mark between 0 and 100. Give one example each of normal, boundary and erroneous test data, and explain what each tests. 6

One mark for each of the following, to a maximum of 6.

  • Normal data such as 57
  • Explains that normal data checks the program works with a typical value
  • Boundary data such as 0 or 100
  • Explains that boundary data tests the exact edge of the allowed range
  • Erroneous data such as the word hello
  • Explains that erroneous data checks the program rejects the wrong type without crashing

Model answer. Normal test data would be a mark of 57. This is a typical value well inside the allowed range, and it tests that the program accepts and processes ordinary input correctly. Boundary test data would be 0 and 100, and also 101, because these sit exactly at the edge of what is allowed. Boundary data is the most valuable kind, since the difference between a condition written as less than 100 and one written as less than or equal to 100 only shows up at exactly that value, and off by one errors are extremely common. Erroneous test data would be entering the word hello. This is the wrong type of data entirely and should never be accepted, so the test checks that the program rejects it with a helpful message rather than crashing when it tries to treat text as a number.