0% found this document useful (0 votes)
35 views25 pages

Question Paper June 2019 (H44601)

Uploaded by

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

Question Paper June 2019 (H44601)

Uploaded by

cvvandradeuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Oxford Cambridge and RSA

Monday 3 June 2019 – Morning


A Level Computer Science
H446/01 Computer Systems
Time allowed: 2 hours 30 minutes
*7677653413*
You may use:
• a ruler (cm/mm)
• an HB pencil
Do not use:
• a calculator

*H44601*

Please write clearly in black ink.


Do not write in the barcodes.

Centre number Candidate number

First name(s)

Last name

INSTRUCTIONS
• Use black ink. You may use an HB pencil for graphs and diagrams.
• Answer all the questions.
• Write your answer to each question in the space provided. Additional paper may be
used if required but you must clearly show your candidate number, centre number
and question number(s).

INFORMATION
• The total mark for this paper is 140.
• The marks for each question are shown in brackets [ ].
• Quality of extended responses will be assessed in questions marked with an asterisk
(*).
• This document consists of 28 pages.

© OCR 2019 [601/4911/5] DC (ST) 172818/4


OCR is an exempt Charity
Turn over
1 A company releases an in-home virtual assistant called ‘Bertie Butler’.
2

The device, when placed in a room, listens out for the phrase “Hey Bertie”. When
someone says that phrase it then listens to the question that follows and tries to give
a relevant answer.

Bertie Butler has a number of built-in input and output devices.

(a) Name one input device and one output device that might be part of Bertie Butler.
For each device give a reason for it being built into the virtual assistant.

Input Device Name: Microphone

Input Device Reason: Listen to what the user says

Output Device Name: Speaker

Output Device Reason: Output answers

[4]

The Bertie Butler device runs off an embedded operating system.

(b) Define the term ‘embedded operating system’.

A simple system designed to perform a specific task

System software

..............................................................................................................................
................ [2]

(c) Bertie Butler’s circuitry is designed to only listen out for “Hey Bertie” under certain
circumstances, which are:

The privacy button (P) must be off and the microphone must generate a signal (S)
to say a sound has been heard.

(i) Complete the truth table for whether the device is listening (L).
P S L
False False False

False True True

True False False

True True False


[2]

(ii) Draw logic gates to represent the circuitry needed.

© OCR 2019
3

[3]

(d) The Bertie Butler machine uses a multicore processor.

Define the term ‘multicore processor’.

A processor with multiple cores which each core can process data at the same
time

..................................................................................................................................
............ [2]

2 A survey is carried out to look at the types of vehicle that travel down a stretch of
motorway.

For each vehicle that passes by, a letter is entered into the system.

For a car ‘C’ is entered.

For a motorbike ‘M’ is entered.

For a lorry ‘L’ is entered.

© OCR 2019 Turn over


4

For any other vehicle ‘O’ is entered.

It is decided to compress the data that has been generated.

(a) State what is meant by the term ‘compression’.

Decrease the amount of stored data

[1]

It is decided that Run Length Encoding will be used.

(b) The following sequence has been compressed using Run Length Encoding.

3C3M4C

Show the result of decompressing the sequence.

CCCMMMCCCC

..............................................................................................................................
................ [2]

(c) Show the result of using Run Length Encoding to compress the sequence:

CCCCOLLLCCCCCMOCCCCC

4C1O3L5C1M1O5C

..............................................................................................................................
................ [3]

The survey takers want to find out the longest continuous sequence of cars in any
given chunk of data. For example, in the data

CCMCCCCLLCCC

the longest

sequence would be 4.

(d) Write the function longest which takes in a string of characters as an argument
and returns an integer representing the longest continuous sequence of Cs.

© OCR 2019
5

Def

longest(cSequence)

Count = 0

Longest = 0

For x = 0 to

cSequence.length -1

If cSequence(x) =

“C” then

Count = Count +

If Count >

Longest then

Longest =

Count

End if

Else

Count = 0

End if

Return longest

End function

[5]

3 A program written in the Little Man Computer instruction set is given below.
INP
STA num
loop LDA total
ADD num
STA total

© OCR 2019 Turn over


6

LDA count
ADD one
STA count
SUB num
BRZ end
BRA loop
end LDA total
OUT
HLT
one DAT 1
num DAT 0 3
count DAT 0 1 2
total DAT 0 3 6
9
(a) State what the program outputs are for the following inputs.
Input Output
1 1

2 4

3 9
[3]

(b) State what the purpose of the program is.

Outputting the inputted number squared

..............................................................................................................................
................ [1]

(c) Explain which registers are used and their values when the line STA count is
executed and the accumulator is holding the value 9. The label count refers to
memory location 16.

MAR holds 16

The accumulator sends the value of 9 to the MDR, the PC holds the memory
location of 16 (10000) as 9 needs to be stored in there, the CU sends a write
signal and 9 is sent along the data bus and stored in memory location 16

..............................................................................................................................
................ [2]

Whilst the line STA count is being executed, the CPU receives a signal from
another process, requiring its attention.

(d) State the name for the signal received by the CPU.

Interrupt

© OCR 2019
7

..............................................................................................................................
................ [1]

(e) The code uses direct addressing. Describe one other mode of addressing.

Indirect addressing

Goes to a memory location holding a value representing another memory


location

..............................................................................................................................
................ [2]

© OCR 2019 Turn over


8

4 Traditionally films have been distributed on optical media such as DVDs.

(a) Giving an example other than DVDs, describe what is meant by the term ‘optical
media’.

A portable and cheap storage device, Blu-ray disks are an example

..............................................................................................................................
................ [2]

(b) Give one advantage of films being distributed using optical media.

Cheap to produce

..............................................................................................................................
................ [1]

Adding a DVD drive to a computer would often require the installation of a piece of
software called a device driver.

(c) State the purpose of a device driver.

A piece of software that allow the CPU to communicate with different devices

..............................................................................................................................
................ [1]

It is now common for people to purchase films which, rather than having a physical copy
of, they can stream or download over the internet whenever they want.

(d) Explain the advantages and disadvantages of owning films that are streamed or
downloaded on demand rather than owning a physical copy.

Advantages: You can access the film anywhere if you have an internet
connection, you do not need to have a space to store a physical copy

Disadvantage: You cannot watch or download the film without an internet


connection, if the server hosting the films is down, no film can be streamed or
downloaded

...............................................................................................................................
............... [4]

Being able to stream high resolution films is only possible due to improvements in
compression.

(e) Explain why compression is important for the streaming of high resolution films.

By using compression less storage is required to store a single film, so more


films can be stored, also, users can load a film faster due to the file being
smaller, and even by using lossy compression, the film still looks identical to a
human being

© OCR 2019
9

..............................................................................................................................
................ [3]

© OCR 2019 Turn over


10

5 A programmer is writing software for a firewall. She is writing code so that it keeps a
track of websites that users are permitted to visit. The software stores the websites’
addresses along with details about who can view them and when.

The following data is also stored about each website:

• Access level needed (1-4)


• If it is available all the time (true) or just lunch times and out of work hours
(false).

So a website which is available to users of access level 2 and above, all the time,
would have the details [2, true] stored.

A website accessible to users of access level 3 and above, only outside of work hours,
would have the details [3, false] stored.

(a) State the name of a data structure that could be used to store a single site’s details.

Tuple

..................................................................................................................................
............ [1]

The address of each website, along with the relevant details, are stored in a hash table.

The hash table’s hash function is carried out on the website’s address (which acts as
the key). The hash function works in the following way:

1. Discard the characters up to and including the first dot.


2. Discard the characters including and to the right of the remaining leftmost dot.
3. Convert the characters to uppercase.
4. Add the ASCII values of the characters together.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
6 66 67 6 69 70 7 7 73 7 7 7 77 78 7 8 81 8 83 84 85 8 8 88 8 90
5 8 1 2 4 5 6 9 0 2 6 7 9
For example www.ocr.org.uk gets hashed in the following manner:

Step 1:

ocr.org

.uk

Step 2:

ocr

Step 3:

© OCR 2019
11

OCR

Step 4:

79+67+82 = 228

giving a hashed value of 228.

(b) State what hashed value would be given by the website www.foo.co.uk

70+79+79 =
228 ...........................................................................................................................
................... [1]

(c) Complete the function hash which takes in a string and returns the hashed value.

You can assume you have access to the following three functions.

• asc() – this takes in a character and returns its ASCII value. For
example asc("A") returns 65.
• locate() – this takes in a string and character and returns the
location of the first instance of the character (with the string starting at
character 0). For example locate("electricity","c") returns 3.
• upper() – this takes in a string and returns the UPPERCASE version.
For example upper("hello") returns "HELLO".

You should also assume that all given website names use letters but no numbers or
symbols.

You will be given credit for the readability of your code

function hash(siteName)

firstDot=locate(siteName,”.”)

siteName = siteName.substring(firstDot+1, siteName.Length-firstDot-1)

secondDot = locate(siteName,”.”)

siteName = siteName.substring(0,secondDot)

siteName = upper(siteName)

hashValue = 0

for x = 0 to siteName.Length - 1

hashValue = asc(siteName.Length(x)) + hashValue

© OCR 2019 Turn over


12

Next i

return hashValue

endfunction

[5]

A flaw with the current hash function is it tends to generate lots of collisions
(addresses that compute to the same hash). Below is a diagram of part of the hash
table. The address www.rnd.com with details [2, true] is being added to the
hash table.

(d) Explain how a hash table can be used to handle collisions, referring to the example
below.

227

228 www.ocr.org.uk : [1, true]


229

230 www.ppf.nz : [2, false]


231

232 www.ntf.biz : [4, true]


234

235

Collisions can be prevented by storing a website in the next available space,


for example, if a website is stored in 228, it would notice that this space is
already taken and would check if 229 is available, and it would be stored in
there, if another website also has the same hash value, then it would look for
the next available space again

..............................................................................................................................
................ [4]

The hash function is changed so there are no longer high numbers of collisions.

© OCR 2019
13

During busy periods the firewall is expected to check several addresses a second. It is
anticipated that roughly 10 new addresses will be added to a whitelist (list of
acceptable addresses) each day.

There is a debate as to whether a hash table (with the new hash function) is the best
approach, or if the whitelist would be better stored in a linked list.

(e) *Discuss whether a hash table or linked list is better to store acceptable websites.
You should compare how each structure can be searched and has data added
and come to a
recommendation as to which is better for the whitelist.

Hash tables make use of a hashing algorithm to produce a hash value and
store the data on its hash value. Linked lists have pointers which points to the
next item on a list

A linked list can be easily changed if new items are added, as the items always
stay on the same memory location, only the pointers are updated to point to
different items. Hash functions needs to first generate a hash value in order to
add new data to the table, as only the hash value is required, hash tables can
be searched very quickly

...............................................................................................................................
....................

© OCR 2019 Turn over


14

6 A company makes anti-virus software.

Anti-virus software is an example of a utility.

(a) Define the term ‘utility’.

A type of software designed to keep the computer safe and working as


intended, such as compression and defragmentation software

[2]

(b) State how an application differs from a utility.

Application is for the user, utility is for the machine

..............................................................................................................................
................ [1]

In order to keep up to date with the latest virus threats, the company is continually
updating their software.

The programmers use an Extreme Programming approach when developing the


updates.

(c) Explain what is meant by Extreme Programming and why it is a suitable approach in
this case.

Ve dps fodase

..............................................................................................................................
................ [4]

(d) Explain why the programmers of anti-virus software may make use of virtual
machines when developing the updates.

By using virtual machines is mimicking an actual machine, the software can be


tested in different emulated devices to ensure it can be run on them, and it also
allows the programmers to test the anti-virus safely to check if the software
detects a virus without infecting the actual device

..............................................................................................................................
................ [3]

When running the anti-virus software, an operating system uses a scheduling algorithm
to determine an allocation of CPU time to the anti-virus software.

(e) Explain why a First Come First Served scheduling algorithm would not be suitable
in this situation.

By using First come first served the instructions would have to be executed in
the order they where received, a longer instruction from a anti malware might
make the CPU to not execute other instructions while the anti-virus is running

© OCR 2019
15

..............................................................................................................................
................ [2]

In the late 1990s the CIH virus hit headlines because it was able to overwrite and
destroy the contents of a computer’s BIOS.

(f) Describe what the effect would be of a computer having its BIOS overwritten.

The computer might not boot as the BIOS holds instructions such as where the
operating system is located to be loaded in main memory

..............................................................................................................................
................ [2]

7 RestaurantReview is a website that allows users to leave reviews and ratings for
different restaurants.

The website uses a database with the following structure.

User Review Restaurant

IRD

The database management system ensures referential integrity is maintained.

(a) Explain what is meant by referential integrity, giving an example which refers to the
database described above.

The quality of the database is maintained/consistent, like if a user is removed it


needs to be removed from the table, and if a restaurant is not running anymore
it needs to be removed so no reviews about it

Cascade Delete effect – delete a user delete all reviews

Delete restaurant delete all reviews

Cascade needs to be properly implemented as deleting a review does not


mean a user should be deleted

...............................................................................................................................
............... [3]

(b) Each review includes a score out of 5. When the score is entered on the website it is
checked in the browser to ensure a number no higher than 5 has been entered. It is
then checked again on the server.

(i) State what is meant by the term ‘server’.

The device which keeps the website running

© OCR 2019 Turn over


16

......................................................................................................................
................ [1]

(ii) Explain why it is important that the review score that the user entered is
also checked server-side.

Static is done in the client-side, database/significant calculations on the


server-side

The user might exploit the website to enter a number higher than 5,
however if it is checked on the server the server would not allow the review
as the score would be higher than 5

.......................................................................................................................
............... [2]

Whenever a review is added to the system, the restaurant’s average rating is


updated. This transaction is ACID.

The A in ACID refers to Atomic.

(c) Describe what is meant by the term ‘Atomic’ in the context of ACID transactions.
You should refer to the example of a review being added.

All or nothing, everything should be done

..............................................................................................................................
................ [2]

(d) State what the letters CID refer to in ACID.

C onsistency

I solation

D urability
[3]

The database previously stored reviews using the ASCII character set. ASCII uses 1
byte per character. It is decided to switch to the Unicode UTF-32 character set
which uses 4 bytes per character.

(e) Give an advantage and disadvantage of changing character sets from ASCII to
Unicode UTF-32.

Advantage More symbols from different languages can be represented as more


characters can be represented in Unicode

...............................................................................................................................
....................

Disadvantage As more bytes are required to store a single character, more


storage will be required to store the database

© OCR 2019
17

..................................................................................................................................
................. [2]

8 A simple program is shown below.

//Program to calculate number of times

//a number goes into 100

count = 0

num = int(input("Enter a number"))

while (count*num)<=100

count=count+1

endwhile

count=count-1

//Take one off as gone over

print(str(num) + " goes into 100 " + str(count) + " times.")

Fig. 8.1

(a) State the output of the program when the number 30 is entered.

30 goes into 100 3 times.

..............................................................................................................................
................ [1]

(b) State the most suitable data type of the variable count

integer

..............................................................................................................................
................ [1]

(c) State the data type of the result of the expression (count*num)<=100

© OCR 2019 Turn over


18

Boolean

..............................................................................................................................
................ [1]

(d) State the data type of the result of the expression

str(num) + " goes into 100 " + str(count) + " times."

String

..............................................................................................................................
................ [1]

(e) Write extra code so the program also displays the remainder.

Remainder = 100 – count * 100

Print (remainder + “ is the remainder.”)

..............................................................................................................................
................ [2]

The program is compiled. The first stage is Lexical Analysis.

(f) Referring to examples in the code in Fig. 8.1, explain what happens in Lexical
Analysis.

Comments and white spaces are removed, key words of a part of the language
are tokenized, like while

..............................................................................................................................
................ [3]

(g) State the name of the stage of compilation that directly follows Lexical Analysis.

Syntax analysis

..............................................................................................................................
................ [1]

9* Discuss the positive and negative impacts computers are having on the environment.

Positive: By using computers many people can work in their houses so there might
be less people travelling on cars

Negative: Multiple computers use a large amount of energy supply,

Computers might have a positive impact on the environment as some people are
able to work in their computers at home therefore they do not need to go to a job by
car which might pollute the environment

Due to computer there are people who go out less on their free time therefore there
are less people polluting the streets

© OCR 2019
19

Computers might have a negative impact due to the large amount of electricity used
on them

.....................................................................................................................................
................ [9] 2 positive 2 negative 1 evalutation

10 (a) Show how the binary number 01011110 is represented in hexadecimal.

0101 1110

5E

..............................................................................................................................
................ [1]

(b) Show how the hexadecimal number 9B is represented in denary.

9B

128 64 32 16 8 4 2 1

1 0 0 1 1 0 1 1

1001-1011

1+2+8+16+128

155 ........................................................................................................................
...........................

..............................................................................................................................
................ [2]

(c) Show how the denary number −87 is represented in sign and magnitude binary.

+- 64 32 16 8 4 2 1

1 1 0 1 0 1 1 1

11010111

..............................................................................................................................
.....................

..............................................................................................................................
.....................

© OCR 2019 Turn over


20

..............................................................................................................................
................ [2]

(d) Complete the following binary subtraction. Show your working.

01001001-
00101111

01001001+11010001= 1(overflow) 10011010

[2]

(e) The floating point binary number 010011 011 consists of a 6-bit mantissa and 3-bit
exponent, both represented in two’s complement. Convert the number to denary,
showing your working.

4.75

..............................................................................................................................
................ [3]

(f) Show the denary number −5.25 in floating point binary form representing the
mantissa and exponent in two’s complement, using as few bits as possible. Show
your working.

101011 011

..............................................................................................................................
................ [4]

11 A web development company makes its money building websites for other
companies.

(a)* The web development company is looking to recruit a programmer to build


websites.

© OCR 2019
21

Discuss the technologies the programmer would need to know and use and the
importance of each one.

HTML is required to write webpages, CSS is required for formatting the pages
and JavaScript is required for allow interactivity

Without Knowing HTML, the programmer would not be able to write webpages
manually, and it would be less efficient to use tools to create HTML without a
programmer as these are quite basic

CSS would allow the page to be formatted and the programmer is expected to
know it for consistency

JavaScript would be required to have interaction on the website as it is like a


programming language.

Programmer would have to be familiarized with databases for retrieve and add
items

...............................................................................................................................
............... [9]

© OCR 2019 Turn over


22
(b) Part of a website’s code is shown below.

<head>
<title>Orville's Oranges</title>
<link rel="stylesheet" type="text/css" href="mainStyle.css">
</head>

Explain the meaning of the code.

Orville’s Oranges is displayed at the top

Page is linked to mainStyle style sheet

.............................................................................................................................................. [2]

(c) The site also contains the following code.

<div class="offer">All oranges 50% off.</div>

Complete the CSS code that would make any div elements of the class offer have an orange
border.

.offer{ border-style:

solid;

Border.color: orange;
}

[2]

© OCR 2019
23
BLANK PAGE PLEASE DO NOT WRITE

ON THIS PAGE BLANK PAGE PLEASE

© OCR 2019
24
DO NOT WRITE ON THIS PAGE PLEASE

DO NOT WRITE ON THIS PAGE

© OCR 2019
25

Oxford Cambridge and RSA


Copyright Information
OCR is committed to seeking permission to reproduce all third-party content that it uses in its assessment materials. OCR has attempted to identify and contact all copyright holders whose
work is used in this paper. To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced in the OCR Copyright
Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download from our public website (www.ocr.org.uk) after the live examination
series.
If OCR has unwittingly failed to correctly acknowledge or clear any third-party content in this assessment material, OCR will be happy to correct its mistake at the earliest possible
opportunity.
For queries or further information please contact The OCR Copyright Team, The Triangle Building, Shaftesbury Road, Cambridge CB2 8EA.
OCR is part of the Cambridge Assessment Group; Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a
department of the University of Cambridge.

© OCR 2019

You might also like