2009 May Computer Science HL Paper 1
2009 May Computer Science HL Paper 1
2009 May Computer Science HL Paper 1
22097011
Computer science
HIGHER level
Paper 1
2 hours 15 minutes
INSTRUCTIONS TO CANDIDATES
2209-7011 9 pages
© International Baccalaureate Organization 2009
– – M09/5/COMSC/HP1/ENG/TZ0/XX
SECTION A
(a) state the value of the maximum integer that can be stored. [1 mark]
(b) state the value of the minimum integer that can be stored. [1 mark]
4. State one advantage of using data compression software on graphics files before
transmitting the files over a network. [1 mark]
6. Describe one difference between a syntax error and a logic error. [2 marks]
7. Outline what is meant by the term user-defined method in relation to Java programs. [1 mark]
9. Explain two differences between the analysis and design stages of the software
development life cycle. [4 marks]
2209-7011
–– M09/5/COMSC/HP1/ENG/TZ0/XX
12. In relation to accessing data stored in a file or an array, state the BigO efficiency of
(a) retrieving a specific data record from a sequential access file. [1 mark]
(b) retrieving a specific data record from a direct access file. [1 mark]
(c) locating a specific data item in an array if the index is known. [1 mark]
(d) locating a specific data item in an array if the index is not known. [1 mark]
(a) define the meaning of the term wide area network (WAN). [2 marks]
(b) State the data type of the value returned by the method. [1 mark]
An integer array b is initialised with the values {12, 23, 34, 45}.
The following call is made.
d = m(12.23, b);
(c) Explain why the assignment a[0] = 23 in the body of the method changes
b[0] in the calling part of the program. [3 marks]
SECTION B
(a) State the output from the call display(1, 3); . [2 marks]
(d) Explain what would happen if the call run(2, 4) was made in the program. [2 marks]
2209-7011
– – M09/5/COMSC/HP1/ENG/TZ0/XX
17. The keyboard shown below controls access to a computer room by allowing a three
character access code to be input followed by pressing the ENTER key. If the
DELETE key is pressed the last character is removed to correct a mistake that has
been made.
A B C D
ENTER DELETE
A buffer is used to store the key presses before they are removed by the processor after
the ENTER key is pressed.
If more than three letters are pressed in succession a warning sound is made.
(a) State the character code that is processed by the computer, given the following
key presses.
A, B, A, DELETE, DELETE, A, C, ENTER [1 mark]
(b) Outline a suitable data structure to store the characters in the buffer. [3 marks]
(c) Outline a sequence of steps to insert characters into the data structure. [3 marks]
18. The diagram below shows a monitoring device with a CPU that has a serial input port
connected to a 4-bit register. The 4 bits represent the number of litres of petrol in a
storage tank as an unsigned integer.
MONITORING
DEVICE
SENSOR
CPU TANK
MONITOR
(a) Calculate, showing your working, the maximum capacity of the storage tank. [2 marks]
When the register is written to, an interrupt is triggered and the CPU executes a
program that checks the value stored in the register. If the value is less than a specified
amount an alert message is displayed on an operator’s monitor.
Data in the sensor on the tank is stored using a 4-bit parallel register. Every 4 minutes
this data is transferred to the monitoring device’s 4-bit register.
(c) Explain the nature of the problem that exists in interfacing the sensor to the
input port. [2 marks]
(d) Identify three steps that are undertaken by the control system after the data is
sent by the sensor. [3 marks]
2209-7011
– – M09/5/COMSC/HP1/ENG/TZ0/XX
19. Users request information from a search engine by entering a query string. For example,
“What is the longest river?”.
(a) State the main characteristic of an operating system that enables many users to
request searches at the same time. [1 mark]
The search software attempts to match the key words in the query string to the location
of the answer. (Note that more than one possible location may be indentified.)
For example, “longest river” is matched to www.riverStats.com and www.RiverNile.com .
(b) Suggest a suitable data structure that could be used to store the key words and
the associated address of the web server. [2 marks]
(c) Explain how the data structure could be efficiently searched using the key words. [2 marks]
(d) Explain what operations would need to be performed on the key words in the
query string to access the data structure. [2 marks]
(e) Identify three modifications that would need to be made to the software in order
to store an ordered list of the most commonly selected locations for each query. [3 marks]
20. Consider the following three classes and the Driver program shown below.
output(things[0].getName());
output(things[1].getName());
output(things[2].getName());
}
}
(b) Explain one advantage of making the variable name private. [2 marks]
(c) Outline the programming technique associated with the use of the key word
extends in
public class Thing1 extends Thing
and
public class Thing2 extends Thing. [2 marks]
(d) Outline the programming technique used to enable the method getName() to
correctly execute in the three output statements. [2 marks]
2209-7011
– – M09/5/COMSC/HP1/ENG/TZ0/XX
A B C F
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
(c) Draw a circuit for the minimised expression obtained in part (b). [3 marks]
2209-7011