June 2010 2 Computer Science Ocr Paper
June 2010 2 Computer Science Ocr Paper
ADVANCED GCE
COMPUTING F453
Advanced Computing Theory
* F 4 5 3 *
INSTRUCTIONS TO CANDIDATES
• Write your name clearly in capital letters, your Centre Number and Candidate Number in the boxes above.
• Use black ink. Pencil may be used for graphs and diagrams only.
• Read each question carefully and make sure that you know what you have to do before starting your answer.
• Answer all the questions.
• Do not write in the bar codes.
• Write your answer to each question in the space provided. Additional paper may be used if necessary but
you must clearly show your Candidate Number, Centre Number and question number(s).
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
© OCR 2010
3
(b) An operating system also uses scheduling.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(i) Explain why intermediate code may be more useful than executable code.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) State what additional software is needed to run the intermediate code.
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
..................................................................................................................................... [1]
(c) When a compiler is used to produce executable code, code generation includes optimisation.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
© OCR 2010
5
3 (a) One feature of Von Neumann architecture is the use of the fetch-execute cycle.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© OCR 2010
7
4 A real binary number may be represented in normalised floating point binary notation using 6 bits
for the mantissa and 2 bits for the exponent, both in two’s complement binary.
0 1 0 1 1 0 0 1
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) Write, in binary, the largest positive number that can be represented in this format.
...................................................................................................................................................
............................................................................................................................................. [2]
(c) For this part of the question, 4 bits are used for the mantissa and 4 bits for the exponent.
(i) Two numbers, A and B, have been written in binary. Only one of the numbers has been
normalised.
number A
1 0 0 1 0 1 1 0
number B
0 0 1 1 1 0 1 0
State which of the numbers has been normalised giving a reason for your answer.
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
© OCR 2010 Turn over
8
(iii) Convert the denary number + 3.5 to binary, giving your answer as a normalised floating
point number using 4 bits for the mantissa and 4 bits for the exponent.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
© OCR 2010
9
5 (a) An array is an example of a static data structure.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) State one advantage of using a static data structure compared with a dynamic data
structure.
...........................................................................................................................................
..................................................................................................................................... [1]
(b) (i) Show the result of merging the following data files.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Write an algorithm to merge two sorted files, stating any assumptions you make.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [6]
Tick the boxes to show the type of programming language for which each statement is
correct.
Procedural
Low-level
oriented
Object-
Data is only accessible through methods
(b) (Any examples you give must be taken from the information listed here.)
The following statements use a language where facts and rules state what to do but not how
to do it.
Part of the solution to chases (X, Y)? includes the following steps:
(i) Give the correct name for this type of programming language.
...........................................................................................................................................
..................................................................................................................................... [1]
© OCR 2010
11
(ii) Give one example of a fact.
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
..................................................................................................................................... [1]
(vi) Explain the term backtracking and give one example of backtracking.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A particular high level language uses local variables, global variables and parameters.
Discuss and compare the use of local variables, global variables and parameters.
(The quality of written communication will be assessed in your answer to this question.)
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [8]
© OCR 2010
13
(c) (i) State what data structure is used when procedures are called during program execution.
..................................................................................................................................... [1]
...........................................................................................................................................
..................................................................................................................................... [1]
...................................................................................................................................................
............................................................................................................................................. [1]
(b) In a large company, each employee is given a staff code. Using BNF, the definition of a staff
code is
<DIGIT> ::= 0 冟 1 冟 2 冟 3 冟 4 冟 5 冟 6 冟 7 冟 8 冟 9
<LETTER> ::= A 冟 B 冟 C 冟 D 冟 E
<STAFF_CODE> ::= <LETTER> <DIGIT> 冟 <STAFF_CODE> <DIGIT>
State how the rules have been broken by each of the following invalid staff codes.
(i) A2C
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) G45
...........................................................................................................................................
..................................................................................................................................... [1]
(c) After changes in the company, it is decided to allocate new codes. Write a definition for
NEW_CODE which has one or more digits followed by zero or more letters. For example,
1234 and 3AB are valid but A25 is not valid.
(You may assume that DIGIT and LETTER are still defined as in part (b).)
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© OCR 2010
15
9 (a) An assembly language uses mnemonics.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(d) Give the correct names for two other modes of addressing.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(e) One feature of assembly language is flow-control. Explain the term flow-control.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
© OCR 2010 Turn over
16
10 A shop sells classical music CDs. The shop uses a relational database to store information about
its products. Data stored about each CD includes the name of the composer, the title, the name of
the artiste or orchestra, the price and the number in stock.
(a) State why the name of the composer is not suitable as a primary key.
...................................................................................................................................................
............................................................................................................................................. [1]
(b) Explain the use of a secondary key from the information given.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Customers are able to register their details and buy CDs from the shop’s website.
CD
(c) (i) State the type of relationship between CUSTOMER_FINANCE and CUSTOMER on the
E-R diagram.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Give one reason why CUSTOMER_FINANCE and CUSTOMER are stored separately.
...........................................................................................................................................
..................................................................................................................................... [1]
(iii) Explain one reason why CUSTOMER and ORDER are stored separately.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
© OCR 2010
17
(iv) State one problem with the relationship between ORDER and CD on the diagram.
...........................................................................................................................................
..................................................................................................................................... [1]
(v) Draw an improved version of the E-R diagram which corrects this problem.
[3]
(d) Some of the Structured Query Language (SQL) used for this database is
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© OCR 2010 Turn over
18
11 (a) Explain why the Unified Modelling Language (UML) is used.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Figures 1, 2 and 3 show parts of some UML diagrams for a security system.
Sensor
PressureSensor MotionSensor
Figure 1
myAlarm :Alarm
Figure 2
getButtonPress(b)
processMessage(b)
setAlarmOn( )
lightOn(b)
Light
Figure 3
© OCR 2010
19
(b) Give the correct name for each type of UML diagram.
Figure 1 .....................................................................................................................................
Figure 2 .....................................................................................................................................
Figure 3 .....................................................................................................................................
[3]
(c) State the feature of object-oriented languages which is shown by the arrow in Figure 1.
............................................................................................................................................. [1]
(d) Taking your information from Figures 1, 2 and 3, give one example of each of the following.
(i) an object
..................................................................................................................................... [1]
(ii) a class
..................................................................................................................................... [1]
(iii) a message
..................................................................................................................................... [1]
© OCR 2010
20
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, is given to all schools that receive assessment material 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 Copyright Team, First Floor, 9 Hills Road, Cambridge CB2 1GE.
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 2010