0% found this document useful (0 votes)
64 views58 pages

A Level Computer Science Task 1

Uploaded by

ict8184
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views58 pages

A Level Computer Science Task 1

Uploaded by

ict8184
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Grade 8 – 9 Resource Pack: All Exam Boards

This resource is aimed at students who are already working at a grade 7 and who are looking to
move to a grade 8 or grade 9 in Computer Science.

There are many general revision resources and textbooks for this course, so this pack focuses on
specific grade 8/9 content and skills, including:
• Extended answers, such as “explain” questions and essays
• More complex topics, such as the TCP/IP model, processor architecture and system security
• Writing algorithms for unseen problems

There are some general revision strategies for achieving the top grades, plus specific grade 8/9
practice on the main topic areas.

There is a significant amount of content that is common to all exam boards, this pack therefore
aims to be appropriate for any student regardless of the exam board they are using. However,
there is some content that will inevitably be more appropriate for one board rather than another.
Therefore, please be aware of the specification you are undergoing and whether each individual
aspect of this resource is suitable for your students.
Contents
Top Grade Revision Strategies ............................................................................................................. 4
Types of exam question.................................................................................................................... 5
Knowledge ................................................................................................................................... 5
Understanding .............................................................................................................................. 5
Essays ........................................................................................................................................... 6
Building up notes and 4 mark answers ............................................................................................ 7
Personal Learning Checklist ................................................................................................................ 9
Topic Revision ................................................................................................................................... 10
Systems Architecture.......................................................................................................................... 11
Diagnosis ........................................................................................................................................ 11
Diagnosis example answers ........................................................................................................... 12
Practice questions ........................................................................................................................... 13
Memory and Storage .......................................................................................................................... 16
Diagnosis ........................................................................................................................................ 17
Diagnosis mark scheme and notes ................................................................................................. 19
Practice ........................................................................................................................................... 21
Networks ............................................................................................................................................ 26
Diagnosis ........................................................................................................................................ 26
Practice ........................................................................................................................................... 28
Practice answers ............................................................................................................................. 30
Security .............................................................................................................................................. 31
Diagnosis ........................................................................................................................................ 32
Diagnosis mark scheme ................................................................................................................. 33
Practice ........................................................................................................................................... 34
Ethical, Legal, Social, Cultural and Environmental issues ................................................................ 35
Diagnosis ........................................................................................................................................ 36
Example essay ................................................................................................................................ 37
Practice ........................................................................................................................................... 38
More essay practice ........................................................................................................................ 40
Component 2 – Algorithms and Programming .................................................................................. 41
Writing code ....................................................................................................................................... 41
Diagnosis ........................................................................................................................................ 41
Diagnosis mark scheme ................................................................................................................. 44
Standard algorithms and techniques .............................................................................................. 44
Switch-case statement ................................................................................................................ 44
If-else statement ......................................................................................................................... 44
For loop ...................................................................................................................................... 45
Conditional loop............................................................................................................................. 45
Some standard list patterns ............................................................................................................ 46
Finding a total ............................................................................................................................ 46
Finding minimum value ............................................................................................................. 46
Counting something in a list ...................................................................................................... 46
Practice ........................................................................................................................................... 54
Final thoughts ..................................................................................................................................... 58
Top Grade Revision Strategies
Getting the top grade is about showing understanding of the whole specification and being able to
apply that to new problems or situations. You are aiming for close to 100% on the paper.

Imaging briefly sitting a year 7 maths test now. Would you get 100%?

I would hope that the answer is yes!

Even if you didn’t get 100% in tests in year 7, you may be able to get 100% if you took the test now,
and the paper would seem easier than it did in year 7. Why? Because your knowledge,
understanding and skills in maths have moved on far enough, and you have used the knowledge
often enough, that the year 7 work now seems easy.

You can do the same thing for your GCSEs. If you are aiming for the top grades you need to know
the material well enough and have gone far enough beyond it that the GCSE exam becomes easy,
so that you can achieve close to 100%.

Part of getting close to 100% is using strategies to make sure that you maximise your marks on
each question, including:
• Getting top band on essays
• Getting full marks on 3-4 mark “explain” questions
• Avoiding “silly” mistakes

These are examples of performance goals, which focus on reaching measureable standards, such
as top band in an essay, rather than outcome goals which are out of your control. Although getting
a grade 9 sounds like a performance goal, it depends on the examiner, so you are not in full control
of the outcome. However, you can make sure that you write in a style that maximises your chance
of getting full marks on an essay, and this is within your control.

The Learning Checklist that follows, includes both performance goals and process goals. Process
goals focus on the actions you need to take during the exam to meet your performance goals. For
example, to meet a performance goal of “get top band in an essay”, you might focus on the
processes of “using technical terms” and “using the PEE structure”.

If you want to achieve the top band, you need to think and write in a manner that shows you
understand the subject. Focus on the actions and behaviours that help you to achieve this and
show it to the examiner.
Types of exam question

In the specification, there will be a list of topics, key points and examples that you will need to
know. The questions could ask you to state, describe or explain any specific example, or use several
examples in an extended answer.

Knowledge
Your knowledge of the key terms will be tested using short (1-2 mark) questions. These require you
to either state one or two of the examples from the specification or define a particular term.

Tips
• Make sure you know all the points on the specification because you don’t know which ones
will come up
• Remember that you cannot use the words in the term in your definition
• Use examples to help your definitions – even for one or two marks, you can write a little
more to guarantee the marks

Practice
• Can you recall all the bullet points for each topic?
• Use mind maps, flash cards and mnemonics to practise recalling all the key examples –
these will form the mark scheme in the exam

Understanding
Your understanding of the key points will be tested using longer questions (3-4 marks), with
command words like “describe” or “explain”.

Getting a top grade means getting full marks on the long answers. To do this you need to be able to
describe and explain each of the points in the specification using clear examples. You may be able
to choose your examples – in which case use examples listed in the specification. You may be asked
to describe specific examples, so make sure that you know all of them.

If the example is one you don’t know, can’t remember or have never seen before, try to relate it to
one of the examples in the specification:
• What are its features? Is it similar to an example you know?
• Which examples is it different to? How? Does this help you to understand it?
• Are there any general principles you can apply?

The following prompts may help you to develop any point into a 3-4 mark answer.
BT-FEST
Because – Therefore – For Example – So That

(This is the old PEE structure in disguise, with some key connectives to help writing style)

As you are writing a sentence, try saying each connective with a slight rising inflection
For example
One way to improve CPU performance is to increase the cache
...because…
this reduces the number of times the RAM is accessed
...therefore…
the execution time is quicker
...because…
the processor is not waiting for instructions to be fetched from the RAM

Now you may not quite write it like this, but checking for

because… therefore… for example… and so that...

will prompt you to think about adding examples and reasons to your answer.

Another way to think of this is answering the questions


What… How… Why… What If..

You can use the connective “such as...” in the same way as “for example...”
Use whatever connectives suit you best: one connective = one extra mark

Essays
To get full marks on the essays you need to
• Cover all the points given in the question
• Write in a clear, well-structured way
• Discuss both/several points of view. You don’t need to agree with both sides, rather you
need to know both sides so you can agree with one and disprove the other!
• Reach a reasoned conclusion, based on the arguments you have given

As a basic structure, write one paragraph per point in the question, plus a conclusion.

Use connectives to make your answer flow. Use the BT-FEST idea from above.

You might want to use the following paragraph structure


1) Make your point
Explain your point clearly with examples
2) Make a counter point from another point of view
Think about how someone would try to argue against your point
3) Reinforce your original point by arguing against the counter argument

In this way, you are arguing for your point of view by both making your view clear and by defeating
any counter arguments.
Building up notes and 4 mark answers
You need to make sure that your notes and revision allow you to get 3-4 marks on any point on the
specification

For example, pick a point such as “character sets”

For 1-2 marks, you need to be able to define a character set clearly

Character sets

• A character set defines how a set of readable characters


• are converted into binary numbers
• to be processed by a computer

Notice how the points are split up to make each key point clear.
This could be expanded with an example
Character sets

• A character set defines how a set of readable characters


o Such as the English alphabet on a keyboard
• are converted into binary numbers
• to be processed by a computer

This could now be up to 3 marks for the description, which should be plenty.

We also know from the specification that we need to know ASCII and Unicode, so let’s expand the
notes further:
• The more bits per character
• the more characters can be represented
o For example, in ASCII only 7 bits are used per character
▪ giving 128 different characters
o whereas in Unicode up to 32 bits are used per character
▪ giving 2^32 different characters
• enough for all the alphabets in the world
Notice how we keep adding layers of technical detail, giving examples and explaining what we mean to keep
adding marks.

It is a good exercise to go through the specification and develop each point to 3-4 marks.
You can do this in lots of different ways
• Using bullet points
o Which could become flash cards
• Using mind maps
o Which could be made interactive

Doing it yourself is important to check that you know the whole specification
Examples

As a mind map

As an interactive applet1

In the interactive version, you can


click to show/hide the points, which
might help you to practice them.

The notes for this pack are in the


interactive form.

As a flash card (to be printed)

• defines how a set of readable


characters
o Such as the English alphabet on
a keyboard
• are converted into binary numbers
Character Set • to be processed by a computer
• The more bits per character
• the more characters can be
represented
o compare ASCII/Unicode

You may also want to turn the notes into labelled diagrams, as images may be easier to remember.
Make sure that you can recall/recreate the 3-4 mark details when you need them.

1
Both the mind map and interactive applet were made using the free software Freeplane
Personal Learning Checklist

Knowledge,
Understanding Process Goal Performance Goal
and Skills
Component 1 – Theory
Systems Refer to the fetch-execute cycle when talking Be able to explain clearly the
Architecture about components and performance function of all the components
of the processor
Link the components together when describing
how the processor works Be able to explain the fetch-
execute cycle

Be able to explain how to


improve processor
performance
Memory and Use the standard list of features when Be able to recommend a
Storage comparing memory and storage technologies storage device for a given
situation
Network Use the TCP/IP model when describing Be able to explain how data is
Technologies network technologies transmitted across a network
System Security Use the standard list of security threats and Achieve top band in each essay
solutions answer

Link each threat to the correct solution(s) and Achieve full marks on explain
combine security solution questions

Start with people as the weak point in a system


Ethical, Legal, Refer to all the points given in the question Achieve top band in each essay
Cultural and answer
Environmental Write using a top-band structure
Concerns
Discuss issues from more than one point of
view
Component 2 – Programming
Writing Break hard problems into smaller steps Be able to write an algorithm in
Algorithms pseudocode for an unseen
Know and use the standard patterns to solve problem
problems
Robust Use your experience of coding to recall good Be able to analyse an unseen
Programming coding practice piece of code

Consider normal, boundary and erroneous test


data
Topic Revision
Systems Architecture
Diagnosis
Explain two ways to improve the performance of a computer system [6]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

Describe how the CPU processes instructions [6]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Diagnosis example answers
Explain two ways to improve the performance of a computer system [6]

• One way to improve the performance of a computer system is to increase the size of the
cache memory on the processor.
• The cache is used to store commonly used instructions, which reduces the number of fetch
operations to fetch instructions from the RAM.
• Fetching data from the RAM is slow, so reduces the number of fetch operations speeds up
the execution of a program.

• Another way to improve computer system performance is to add a graphics card.


• The graphics card contains specialised processors that are optimised to process graphics,
for example by parallel processing.
• This improves the run time of graphics programs as the graphics routines are executed
more quickly.
• Furthermore, graphics processing is handled by the graphics card, so the main CPU can
process other instructions, allowing the system to process more data in the same
timeframe as a system without a dedicated graphics processor.

There are several ways given in the specification to improve system performance. I have picked
two – you may have picked others. The full list is given in the revision notes.

You get 3 marks per method of improving performance:


1 mark for stating how to improve it, e.g. increase cache size
2 marks for explaining how the change improves performance

Notice how the full mark answer develops each point.


• The points are linked in a logical order.
• The answer shows coverage of the key points in the specification.
• You can add detail by
o Explaining what the component does or how it works
o Referring to the fetch-execute cycle (using technical language and linking topics)
o Explaining where the increase in performance comes from

Describe how the CPU processes instructions [6]

• The CPU fetches the next instruction to be processed from the RAM.
• The address of the next instruction is stored in the program counter.
• The address is passed to the memory address register
o and the data is fetched from the RAM into the memory data register.
• The instruction is decoded by the processor
o which executes the instruction.
• The control unit controls the fetch execute cycle
o by sending control signals to all the components connected to the processor.
(Up to 6 marks for valid steps)

You need to know this list of steps for the F-E cycle.
Make sure that you refer to the components of the CPU and link them to the F-E cycle
Practice questions
Use the same mark scheme as the diagnosis questions and check your points against the notes.

Describe how the CPU processes data, referring to the following in your answer: [6]
* The fetch-execute cycle
* RAM
* registers in the CPU

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Explain how each of the following will improve computer system performance [3 marks each]
• Increasing the number of cores
• Increasing the cache size
• Increasing the clock speed
• Increasing the amount of RAM
• Adding a graphics card

Note that this is too big for a normal exam question. However, you might as well practice all of
them for revision. In a real exam question you might only be asked about two or three specific
ways, or you may be able to choose your own examples.

Number of cores [3]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

Cache size [3]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Clock speed [3]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

RAM [3]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

Graphics card [3]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Memory and Storage
The table below shows the standard ways to compare storage technologies. You will need to apply these criteria to different scenarios.

Technology Example Capacity Read/Write Portability Durability Reliability Cost Common uses
devices Speed
Optical CD, DVD, Low Slow Reasonable. Small Immune to magnetic Reasonable. Low Sending SW,
Blu- and light. fields, but easily Data cannot be backing up files
ray(TM) scratched. overwritten. e.g. photos
However, fewer
devices now have
DVD players.

Magnetic Hard Disk High Medium – Poor. Many moving Not great, Susceptible Very good. Low per Secondary storage
(Built in faster than parts, so needs to be to damage from Hard disk can be GB, but in PC or network.
and optical, but still when in use. movement and from overwritten many quite Portable HDD are
portable) slower than Much larger than magnetic fields. times. expensive also popular for
solid state other media. backing up files
Solid State Solid Medium Fast Very portable. Can be Very durable. Very good. Most High per Moving devices,
State Hard made into tiny devices have USB GB e.g. cameras,
Disk, SD memory cards. No connections for phones, drones.
card, moving parts, so can memory sticks. High-performance
Flash be used on the move However, SD cards PCs,
drive/me require special Laptops
mory stick readers.
Also, solid state
drives can be
written to fewer
times than magnetic
media.
Diagnosis
Alice is going on holiday at the end of year 11 and is taking her digital camera and laptop to record
her journey. She wants to be able to store photos and videos of her trip. She will transfer the files
to her laptop each day so that she has enough space on her camera for more images. She also
wants to keep a backup copy of her photos and videos in case her laptop is damaged or stolen.

The camera uses solid state memory.


Explain two reasons why this is the most appropriate storage technology for this device. [6]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Alice is considering two ways to back up her files
* On a memory stick
* On a portable hard drive

Discuss which solution would be the most appropriate. * Your quality of written communication
will be assessed in this answer [8]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Diagnosis mark scheme and notes

The camera uses solid state memory.


Explain why this is the most appropriate storage technology for this device.

• Solid state memory has no moving parts


o and therefore, it is not affected by movement.
▪ This is important in a camera because the camera may be in motion when
data is being written to the SD card
• especially if she is filming a tracking shot

• Solid state memory has very fast write times


o which means that the camera can store more data per second
▪ This means that the camera can store more frames per second
• so it can record in slow motion
• or it can take pictures faster

You could have used any two of the features from the table – why not try the question again and
use two different criteria

To get 3 marks for a reason you need


1 mark for identifying a correct feature of the technology from the standard list in the table
1 mark for describing the benefit of this feature
1 mark for linking this back to the context

Don’t just go for the first one you think of, e.g. small; you need to pick something you can write
about in detail.

Notice again how the extra marks are gained by adding clear technical details taken from the table.
Also notice how the notes in the table are linked back to the context, for example linking the
read/write time to the frame rate of the camera.

If you are not sure about the context/detail, consider using “maybe” in the sentence or giving a
range of examples such as in the second answer.
Alice is considering two ways to back up her files
* On a memory stick
* On a portable hard drive

Discuss which solution would be the most appropriate.

Example answer:
A memory stick may be appropriate because it is very small and is therefore portable. Also,
memory sticks are now relatively cheap for their capacity. However, depending on how long she is
travelling, a memory stick might not have enough capacity for her videos, which may be very
large files. Furthermore, a small memory stick might also be easy to lose while she is travelling.

An alternative option would be a portable hard drive. This may be larger than a memory stick,
however modern portable drives are not much bigger. Furthermore, portable hard drives can have
a very large capacity, potentially up to a terabyte, so she should be able to store all her videos
and photos. Portable hard drives are sensitive to movement when they are being accessed, but
Alice can back up her files when appropriate, so this should not be a factor. Also, rugged cases for
hard drives are cheap and this would help her to protect her data.

Overall, I think that the best choice would be a portable hard drive because the increased capacity
and reduced risk of losing the drive make it more useful for backing up large files while travelling.

This should get a top band because:


• Both points given in the question are discussed
• It considers a range of technological features from the table
• It uses clear paragraphs and connectives to have a top-band style
• Each point is discussed with pros and cons related to the context give
• There is a clear conclusion based on the arguments already made
Practice

Software companies often sell software on DVD.


Explain why this is a suitable medium to distribute software [4]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Alice is going on holiday at the end of year 11 and is taking her digital camera and laptop to record
her journey. She wants to be able to store photos and videos of her trip. She will transfer the files
to her laptop each day so that she has enough space on her camera for more images. She also
wants to keep a backup copy of her photos and videos in case her laptop is damaged or stolen.

Alice is considering backing up her photos to the cloud.


Discuss whether this is a suitable choice* Your quality of written communication will be assessed in
this answer. [8]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
A manufacturer is making a high-quality slow motion digital video camera for students to record
science experiments. Discuss which form of storage would be most appropriate for this device* [8]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Software companies often sell software on DVD.
Explain why this is a suitable medium to distribute software [4]

Points may include:


• Small, light and flat,
- so easy to package and easy to post
• Very cheap for capacity,
- so easy to mass produce
• Capacity is appropriate for modern installers
- which are relatively small
- because extra content can be downloaded via the internet once the SW is installed

1 mark for a valid point


1 mark for explanation of point related to the context

Alice is considering backing up her photos to the cloud. Discuss whether this is a good choice. [8]

Points for
• Many devices have automatic uploads
• so she doesn’t need to remember to back up the files
• so she is less likely to lose them

• Cloud storage is free on some services/she may already have cloud storage through
school or work
o so there is no additional cost for the backup

• Cloud storage capacity is very large


• possibly unlimited
• and she can buy extra space easily if she needs it
Points against
• Backing up to cloud storage requires an internet connection
• which she may not have if she is abroad
• or may cost more
o particularly if she needs to use a mobile connection
o or pay for internet access in a hotel/internet cafe

• Automatic backups could be expensive


• if she inadvertently incurs data roaming charges
Conclusion
If she is expecting to have reliable internet connection then cloud storage is a good idea. However,
if she is somewhere without internet then she will need another solution, such as a portable hard
drive.

Full marks if
• You several points for and against (at least two of each)
• You made clear technical points from the table
• Your points were linked back to the context of travelling
• You made a valid conclusion based on your points
A manufacturer is making a high-quality slow motion digital video camera for students to record
science experiments. Discuss which form of storage would be most appropriate for this device. [8]

Possible points
SD Card
Points for
* Fast read-write times
which are good for slow-motion

* Very small
keeping camera small/light
and therefore easier to students to use

* Very robust
useful if the camera may be used by students

* can be removed/replaced
so students can keep their own videos/other groups of students can use the camera

* Good capacity
May be sufficient for videos – often used in cameras

Points against
* is the read/write time fast enough, or is a solid-state drive needed?
* is there a risk of the cards being lost?
* is the capacity large enough for the quality of video?

Solid state hard drive


Points for
* Very large capacity
for storing large amounts of high-quality slow motion video

* Very fast read-write times


for storing high frame rate

Points against
* Very expensive
Is the device too expensive?

*very bulky/heavy
not ideal in a portable camera

Students may also discuss DVD as a possible storage method

Full marks if
• You considered two or more solutions
• You made clear technical points about each one
• and linked these to the context pf a camera for students
• and you drew a valid conclusion based on your arguments
Networks
Diagnosis
I have written an email on my mail client on my phone. When I press send, the email is sent to my
mail server using the address mail.school.co.uk
Explain how the email is sent to my mail server. [6]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Diagnosis mark scheme and notes

1 mark per valid point to max 6


For 6 marks, the answer must reference
• The sending device
• Routers
• The receiving device

• First the sending device will look up the IP address of the mail server on a DNS server.
o This is a database that matches IP address with domain names.
• Next the data is split into packets.
o Each packet is given the source and destination IP address
o and also a sequence number.
• The packets are sent onto the internet.
o Routers use the destination IP addresses to send the data to the mail server by the
most efficient route.
o Each packet may take a different route.
• The mail server receives the packets and uses the sequence numbers to reassemble them
into the right order.
o If any packets are missing the mail server can send a request that the packet is
resent.

Notice that this is just an explain question, not an essay, so there are no marks for the quality of
written communication.
• This means that you can list the key points in clear sentences.
• Make sure that you cover all the key devices – they weren’t given in the question, but it still
helps to talk about senders, receivers and routers.
• Remember to talk about devices not people!

Networks is a big topic


There is a lot to remember – it may help to turn the notes into a large, labelled diagram.
It helps if you can remember the basic principles in the TCP/IP model – this will help you to fill in
any gaps.

Remember that networks are designed using the same principles as the phone system or the post
office. If you think about making a phone call, or sending a letter, then you already know the main
steps and principles!
Practice
Explain how the following devices are used when a computer connects to a website

Router [2]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

DNS Server [2]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

Ethernet card [2]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Explain the importance of protocols in network communications, giving an example of a common
protocol [4]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Practice answers
Explain how the following devices are used when a computer connects to a website

Router

• Uses the destination IP address


• in a packet
• to route the packet to the destination by the quickest route
• Routers can route packets around network congestion

DNS Server
• A DNS server converts a Domain Name
o such as google.com
• into an IP address

Ethernet card
• An Ethernet card allows a computer to connect to a network
• by converting data into the correct format to be sent on the network
• such as via an Ethernet cable

Explain the importance of protocols in network communications, giving an example of a common


protocol

• Protocols are a standard for communication


o which means that any device or software using the protocols can connect to any
other device or service using the same protocols
▪ For example, a webserver will be set up to send and receive traffic using the
http protocol
• which can be read and displayed by any web browser
You must have an example of a protocol for full marks.
Security
There are two ways to think about security
• know the risks and think about solutions
• know security strategies and think about the problems they solve

While there is a solution to each risk, in many cases you will need to consider either multiple
solutions to one risk or multiple benefits of one strategy. The problems and solutions overlap in
many ways. Use this to help you remember the points or develop an answer – if you can
remember one point, the links may help you to remember more.

When analysing a scenario, you may want to consider the following principles:

• Most data loss is accidental, either by employee error or employees losing laptops, memory
sticks etc.
• Most malicious damage is done by employees not hackers
o either for money
o or for revenge

The people are the biggest risk


• Training staff
• Control access to systems
• Have software in place to monitor systems
• Reduce external data, e.g. Internet access, USB memory sticks etc.
• Don’t allow staff to use their own devices, or take sensitive data off site

Any automated systems, security check etc. need to be


• Up to date, to deal with the latest threats
• Repeated at regular intervals

Some specific risks and strategies are summarised in the notes. Check your specification carefully,
as the required examples are slightly different for each exam board.
Diagnosis
A school has developed a revision app for students. Students can sign up and then log in to
complete tasks and receive feedback. The app stores data about the students, such as target
grades and SEN needs to help tailor the questions to their needs.

Explain two security risks to the system and how they may be reduced. [6]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Diagnosis mark scheme

A school has developed a revision app for students. Students can sign up and then log in to
complete tasks and receive feedback. The app stores data about the students, such as target
grades and SEN needs to help tailor the questions to their needs.

Explain two security risks to the system and how they may be reduced. [6]

Example answer
• One risk is theft of sensitive data about the students.
o This could be through hackers accessing the data stored by the app.
• One way hackers could do this is by a brute force attack to find a user’s password.
o To reduce this risk the system should indicate to students how strong their
password is and only allow passwords that meet secure conditions,
▪ such as being longer that 8 characters.
o Furthermore, the system should lock after three wrong password attempts
▪ to stop hackers using software to automatically try large numbers of
passwords.
• The system could also use Captcha’s or similar tools to prevent automated attacks by bots.
• To further reduce the risks from theft, the data stored by the system should be encrypted
so that stolen data cannot be read by thieves.

• Another risk is SQL injection.


• A hacker could access the app data by typing SQL commands into input forms on the site.
o This risk can be reduced by ensuring that all inputs in forms are validated,
o and any command characters are removed before the input is processed.
o Many web authoring packages include SQL injection protection as standard.

The answer here is more than is needed for 6 marks, to show you how each answer can be
extended.

For three marks, you need


• A valid risk from the table
• A description of what the risk is
• One suggestion of how to reduce the risk

You need to explain two risks and you get three marks per risk explained

You can redo this question several times, picking a different two risks each time.
You can also flip the question and ask, “Explain two ways the data in the app can be protected
from theft.”

There are many variations on this question.


Make sure you can get three marks for each risk and solution listed in your specification.
Practice
A school stores a large amount of student data on its network, including medical details for trips.

Explain three risks to the school network, and steps the school can take to reduce these risks. [9]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Ethical, Legal, Social, Cultural and Environmental issues
This is a very broad topic and is likely to be an essay.

Good practice is to read regularly the technology sections of national newspapers or websites to
consider the big topics in computing.

You will need to be able to discuss the scenario given from several points of view – there may be
prompts for this given in the question.

It may be easiest to approach the scenario with a series of questions that you can then discuss.
Some possible starting points for discussion are given below.

Use the writing structures given at the start of the booklet particularly
point-counter point-reinforce original point

Issue Prompt Questions


Ethical issues What is morally right? What is socially right?
Who benefits? Who loses out?
Do users understand what they are doing?
Do users have choices? Can they opt in and/or opt out?
Does the digital divide get bigger?
Legal issues Is there any data to protect?
Cultural issues Does everyone have access?
Is there any discrimination?
Environmental issues How is the tech made?
How is old tech disposed of?
Privacy issues Is user data kept secure?
Is the data protection act followed?
Stakeholders Who will use this?
Who needs it?
How are businesses affected?
How are consumers affected?
Technology What new technology is needed?
Diagnosis

A tech business is considering developing a new fitness watch. Discuss the issues they will need to
consider when developing their device including:
• Stakeholders
• Technology
• Ethical issues
• Environmental issues
• Legal issues
Your quality of written communication will be assessed in this answer.

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Example essay

The tech business will need to consider the needs of the owners or shareholders in the business,
who will be keen that the device is profitable for the company. This means that the device must be
manufactured cheaply enough to turn a profit, while maintaining quality to keep the consumers
happy. There is an ethical issue here as the company should not use exploitative manufacturing
methods and should consider using renewable resources.

Consumers will be keen that the watch is compatible with a range of smart phones and devices, so
that they can use the watch with their existing devices. The company can achieve this by using
existing standards for connectivity, such as Bluetooth and USB. This will also help to ensure that
their device sells into a larger market. The company must also ensure that the device doesn’t
adversely affect any existing devices with which it is used.

The company should consider making the watch robust enough to last for several years, both in
terms of the reliability of its hardware and in terms of its software. The device should be able to be
updated as other technology and apps develop. To achieve this the developer could use a standard
operating system with the ability to receive automatic updates. The developer could consider using
an open-source OS to allow other developers and users to develop or maintain the device in the
future. It is more environmentally friendly if devices last longer as there is less waste, however
consumers may still want a new device anyway.

The fitness watch may collect data about the user, such as their location, and the company needs
to ensure the security of the user’s data. For example, the device could include a password to
unlock it. Any data sent to the company should be encrypted before it is transmitted, so that it
cannot be read if it is intercepted. Furthermore, if any data is stored by the company, they must
store it securely, in line with the data protection act. The company must be clear with the user
what data will be collected and how it shall be used.

The watch may also include sensors such as a microphone for voice control. While this is a useful
feature for the user, there is a security risk if the device is hacked; the microphone could be used
to monitor users without their knowledge. Therefore, the company must make sure that the watch
includes appropriate security measures, for example, meeting industry standards and using well
established security protocols. The company should carry out sufficient testing to ensure that the
device and any security measures are robust, including penetration testing on their own network.

Notice the following for a top band


• All the prompts in the question have been addressed
• The answers draw in technical content from across the specification
• Each point is quite brief, but the points are well linked so they give a wide range of issues
related to the context.
• Everything is related back to the context, including a min-conclusion for each paragraph
giving the impact on the company or the actions they must take to address the issue
Practice
Discuss the issues relating to the introduction of driverless cars, including:
• Legal issues
• Ethical issues
• Environmental issues

Your quality of written communication will be assessed in this answer

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Practice essay
Suggested points

Legal issues
• Who is culpable in a crash? The driver? The manufacturer?
• Who has responsibility for testing the car? The programmer? The manufacturer? The
retailer?
• What data is collect by the vehicle? How is it stored in line with the data protection act?
Does it meet the RIPA? (I.e. can the manufacturer spy on your movements?)
• Who sets the standards for controlling communication between cars?

Note that data could improve legal cases if it can be used to prove responsibility in a crash

Ethical issues
• Can AI make decisions in life-threatening situations?
• Who is responsible for safety?
• What data is gathered? Is it used ethically and with full knowledge of the drivers?

• Driverless cars can improve mobility, particularly for the elderly/sick


• Driverless cars may be safer, if set up correctly
• May be some early risks that pay off later, like air travel – are we willing to take that risk?

Environmental issues
• may improve air quality if AI drives more economically
• may reduce fuel use
• may result in scrappage of old cars – could be both good or bad
• If cars can run more closely, would traffic increase?

Note that these are not marking points per se. Rather they are prompts for points that you may
have considered. To get the top band you don’t need to make these specific points, rather you
need to:
• Make a range of technical points
• Consider all the prompts in the question
• Consider different points of view
• Back up your points with evidence and examples

Some of the points are open-ended and there is no single right/wrong answer.

If you are not sure if you would get the top band, then your work is probably not clear enough yet.
More essay practice

Discuss the ethical and legal issues for an ISP monitoring customer Internet use

Discuss the impact of increasing use of mobile technology on young people

Discuss the benefits and risks of a large business allowing staff to use their mobile devices on the
company Wi-Fi

“All major operating systems should be open source”.


Discuss how far you agree with this statement.

A tech firm is considering developing smart implants for people who have lost limbs in accidents.
Discuss the ethical, legal and environmental issues they need to consider.
Component 2 – Algorithms and Programming

Writing code
Diagnosis

Write a function to convert a 2-digit hexadecimal number into denary. The hexadecimal number is
passed as a parameter to the function. The subroutine hex_digit(x) converts a single hex digit from
0 to F into the equivalent denary number and you may use this function in your solution if you
wish. [5]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Here are the names and test marks for several students on different topics, stored in a 2D array
called scores.
scores[0,0] is “Alex”, scores[0,1] is 80 and scores[1,0] is “Bob”
Write an algorithm to find the range of the marks [8]

Alex 80 85 83 79 92
Bob 87 88 90 84 87
Charlie 95 95 100 95 95
Danni 92 93 92 96 98

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Explain the benefits of defensive programming [4]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

Explain two features of an IDE that help developers write robust code [6]

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………………
Diagnosis mark scheme

Writing code for an unseen problem is one of the hardest skills in computer science.
Luckily, the whole subject is designed to give you a method to use to solve an unseen problem!
Hopefully you already have plenty of experience writing your own code and solving problems.

Before we analyse the diagnostic questions, here are some standard algorithms and coding
patterns you should be able to recognise, write and use.

Standard algorithms and techniques

Switch-case statement
Used for: Choosing one of a list of possible options
Example
function calculate(x, y, operator)
switch operator:
case +:
return x + y
case -:
return x – y
case *:
return x*y
case /:
return x/y
case default:
return “unknown operator”

If-else statement
Used for: deciding if something has happened

if mark > 40 then


return pass

if mark > 40 then


return pass
else
return fail

Nested if are similar to a switch-case statement

if mark > 80 then


return top band
else
if mark > 40 then
return pass
else
return fail
For loop
Used for: looping through a list of items OR looping a fixed number of times
Example
Make sure you can loop through the items in a list or 1D array, using the indexes

prices = [10, 12, 30, 5, 7]


for i = 0 to 4
print(prices[i])
next i

You can use two for loops to go through a 2D array


board = [[0, 0, 0],
[1, 0, 0],
[0, 0, 0]]

for i = 0 to 2
for j = 0 to 2
print(board[i,j])
next j
next i

You can combine a loop with a flag variable and an if statement to check if something occurs in the
list

flag = False
prices = [10, 12, 30, 5, 7]
for i = 0 to 4
if prices[i] > 10 then
flag = True
end if
next i
if flag then
print(“There are items over £10”)
end if

Conditional loop
Used for: looping an unknown number of times
Examples

password = “”
while len(password) < 8 do
INPUT password
end while
Some standard list patterns
Finding a total

Using the “in” pattern

total = 0
for value in list
total = total + value
print total

Using a while loop and an index

total = 0
i=0
while i < len(list)
total = total + list[i]
i=i+1
print total

Using a for loop and the index (we will use this pattern)

total = 0
for i = 0 to len(list) – 1
total = total + list[i]
next i
print total

Finding minimum value

min = list[0]
for i = 1 to len(list) – 1
if list[i] < min then
min = list[i]
end if
next i
print min

Counting something in a list

count = 0
for i = 0 to len(list) – 1
if list[i] == value_to_find then
count = count + 1
end if
next i
print count
Combining ideas – finding the average of all the items over £100

total = 0
count = 0
for i = 0 to len(list) – 1
if list[i] > 100 then
total = total + list[i]
count = count + 1
end if
next i
average = total / count
print average

Find the student with the highest average grade across the five tests and print their name and
average score.
Scores is a 2D array as before
Test1 Test2 Test3 Test4 Test5
Alex 80 85 83 79 92
Bob 87 88 90 84 87
Charlie 95 95 100 95 95
Danni 92 93 92 96 98

max_value = 0
max_name = “”
for i = 0 to 4
total = 0
for j = 1 to 5
total = total + scores[i,j]
next j
average = total/5
if average > max_value then
max_value = average
max_name = scores[i,0]
end if
next i
print max_name, max_value
Here’s how to build up the last answer in stages:

1) Loop through all the scores for all the students

for i = 0 to 4
for j = 1 to 5

next j
next i

2)
Calculate the average for one student

for i = 0 to 4
total = 0
for j = 1 to 5
total = total + scores[i,j]
next j
average = total/5
next i

3)
Check if the average is a maximum

max_value = 0
max_name = “”
for i = 0 to 4
total = 0
for j = 1 to 5
total = total + scores[i,j]
next j
average = total/5
if average > max_value then
max_value = average
max_name = scores[i,0]
end if
next i
4)
Print the results
max_value = 0
max_name = “”
for i = 0 to 4
total = 0
for j = 1 to 5
total = total + scores[i,j]
next j
average = total/5
if average > max_value then
max_value = average
max_name = scores[i,0]
end if
next i
print max_name, max_value

Armed with these standard patterms, you can now use some or all of the following problem
solving strategy...

Problem solving strategy

1) List the main steps of the problem


2) Break these down into sub steps
You may need to re-order or add steps
3) Spot any standard patterns, e.g. is this a 2D array, i.e. two for loops?
4) Identify any decisions – these are your if statements
5) Identify any calculations
6) Identify any loops – does anything need repeating?
7) Idenifty any variables
these will be the nouns in your bullet points
Do you need any variables for your calculations? Any temporary results? Any counters etc.
for your loops?
8) Start writing your code
Define you function
What is its name? What are the parameters? What is the return value?
Initialise any variables, e.g. set total to 0
Start coding your bullet points
Can you code the main calculation?
Check your loops
Check the code produces the right answer (hand trace)
Here are the diagnostic questions again:

Write a function to convert a 2 digit hexadecimal number into denary. The hexadecimal number is
passed as a parameter to the function. The subroutine hex_digit(x) converts a single hex digit from
0 to F into the equivalent denary number and you may use this function in your solution if you
wish

Solution:

function hex_to_den(hex)
digit0 = hex[0]
den0 = hex_digit(digit0)
digit1 = hex[1]
den1 = hex_digit(digit1)
denary = 16*den0 + den1
return denary

You’ll get a mark for


• the function definition – you can always give the name of your function and any define any
parameters
• the correct return value
• using the subroutine provided – check what is given to you in the question. Remember to
only write the function requested, for example don’t start worrying about uer input if that
is handled by a subroutine.
• the correct calculation
• using the indexes correctly
Here are the test marks for several students on different topics.
Write an algorithm to find the range of the marks
Alex 80 85 83 79 92
Bob 87 88 90 84 87
Charlie 95 95 100 95 95
Danni 92 93 92 96 98

Step 1
This is a 2D array, so probably two for loops

for i = 0 to 3
for j = 1 to 5
next j
next i

Step 2
We need to identify the key calculation and what data is needed
In this case we need the range, so we need the largest and smallest values in the array
These are standard patterns from earlier

max = scores[0,1] #set to first value in array to give something to compare to


min = scores[0,1]
for i = 0 to 3
for j = 1 to 5
next j
next i

max = scores[0,1] #set to first value in array to give something to compare to


min = scores[0,1]
for i = 0 to 3
for j = 1 to 5
if scores[i,j] > max then
max = scores[i,j]
end if
if scores[i,j] < min then #this could be an elseif
min = scores[i,j]
end if
next j
next i
Step 3
complete the calculation and return the answer

max = scores[0,1] #set to first value in array to give something to compare to


min = scores[0,1]
for i = 0 to 3
for j = 1 to 5
if scores[i,j] > max then
max = scores[i,j]
end if
if scores[i,j] < min then #this could be an elseif
min = scores[i,j]
end if
next j
next i
range = max – min #could return max-min directly
return range

Notice how we built this up by combining known patterns.


It doesn’t really matter what is in the array. We just loop through it and pick out the required
values for the calculation.
Explain the benefits of defensive programming

2 marks for valid points


2 marks for valid examples or explanations of points

e.g.
• Input validation prevents the program from crashing
• By ensuring that input are of the correct data types
• Such as integers for calculations

• Input sanitisation avoids security issues


• Such as SQL injection
• By removing command characters from input boxes

Explain two features of an IDE that help developers write robust code

1 mark for named feature


2 marks for valid explanation

Example
One feature of an IDE that aids development of robust code is a run-time environment that allows
the developer to test code without having to compile it and install it on the target device. For
example, an android developer could use a run-time environment to test that a program works on
many different phones without owning them

Another feature of an IDE is code completion and syntax highlighting, which may help the
developer to use a good coding style by automatically indenting code correctly and by enforcing
the use of sensible variable names.

In this case no context was given, so you can give your own examples
However, you may need to relate you points to a scenario
Practice
1. Write an algorithm to find the total price of this order
The order is stored in an array called order like this:
85 102 76 130 26

Items over £100 get a 10% discount


VAT must be added at the end at 20%

2. Write an algorithm to
• Ask the user to input a sequence of test scores
• Calculate the average of the scores
• The program should ask for inputs until the user inputs -1
o this value is not included in the average

3. Using the scores array from before

a) Write an algorithm to find the student with the lowest range in their scores

b) Write an algorithm to store any students with an average score below 90 in an array

4. Ask the user for a password and check that it contains


• at least 8 characters
• at least one number
• at least one uppercase and one lowercase character
Output “valid” if it meets all three conditions or a suitable error message if not

Note that ord(c) returns the ASCII code for a character


(You can check in the text book the ASCII ranges for uppercase, lowercase and numbers)

5. Find the name of the first item that costs more than £200
The names and prices are stored in two 1D arrays like this

names
T-shirt Trousers Boots Jacket Hat Rucksack Tent

prices
10.0 36.99 99.99 129.99 12 104.99 230.0

Notice how you can come up with lots of variants easily for more practice, for example
• Change the calculation
• Add layers of complexity, such as discounts
6. This algorithm is supposed to find the median of list of numbers, stored in a 1D array called
“numbers”
Correct the code

n = numbers.length #alternative way to get the length of a list or array


mid = numbers / 2
median = numbers[mid]
OUTPUT median

7. Here is an algorithm to count the number of prices greater than or equal to £100 in a list called
prices

x=0
for i = 1 to len(prices) – 1
if list[i] > 100 then
x=x+1
end if
next i
print x

Fix an error in the algorithm


Explain how the developer could have improved the code to make it easier to maintain
Sample answers
1.
total = 0
for i = 0 to len(order)-1
if order[i] > 100 then
total = total + order[i]*0.9
else
total = total + order[i]
end if
total = total*1.2
print total

2.
score = 0
total = 0
count = 0
while score <> -1
OUTPUT “Please enter a score”
INPUT score
if score <> -1 then
total = total + score
count = count + 1
end if
end while
OUTPUT total/count

3. See earlier example – can you adapt it?


4.
valid = False
while not valid
len = False
lower = False
upper = False
num = False
OUPUT “Please choose a password”
INPUT password
for i = 0 to password.length – 1
code = ord(password[i])
if 48 <= code <= 57 then
num = True
else if 65 <= code <= 90 then
upper = True
else if 97 <= code <= 122 then
lower = True
end if
if password.length >= 8 and upper and lower and num then
OUTPUT “Valid”
valid = True
end if
end while

5. See earlier array patterns

6.
n = numbers.length #alternative way to get the length of a list or array
numbers.sort #sort the list before finding the median
if n MOD 2 == 1 then #i.e. if n is an odd number
mid = n-1 / 2 #-1 as the indexes start at 0
median = numbers[mid]
else
mid = n/2
median = (numbers[mid] + numbers[mid-1]) / 2 #average of the two middle numbers
end if
OUTPUT median

7.
count = 0 #use meaningful variable names
for i = 0 to len(prices) – 1 #index from 0
if prices[i] >= 100 then #check name and >=
count = count + 1 #use indentation to improve readability
end if
next i
print count
If you want extra practice coding beyond GCSE try these:

Think Python: a very good book (and free!) explaining thinking strategies for problem solving and
how these link to code. Chapters 1-14 are sufficient for GCSE.
http://openbookproject.net/thinkcs/python/english3e/

BIO: the British Informatics Olympiad. Lots of hard coding problems. Like the maths challenge…
only for programming!
http://www.olympiad.org.uk/

Final thoughts
Getting a top grade is about practicing the knowledge, understanding and skills required to get full
marks in such a way as to produce your best on the day. This includes having an A* mind-set.

• Be confident in your ability to answer questions.


• Start with a simple point… and then build on it
• Practice all the points in the specification to 3 mark depth
• Use connectives to improve your writing style
• Use technical language in context
• Read the question and refer to the context
• Check your answers carefully
• Read around the subject

You chose to study this and you are working at the top grades – enjoy it and show off!

Good luck!

You might also like