A-level Computer Science worked answers

OCR A-level Computer Science H446

Trace the state, then write the code

Component 02: Algorithms and programming

Specification
2.2.1(a)
Marks
10
Suggested time
15 minutes
Calculator
Not permitted

A program totals readings greater than 4. Array indexing starts at 0. The for loop includes both its first and last index. Record the trace at the end of each loop pass, after any addition.

01 array readings[5] = [3, 8, 2, 7, 4]
02 total = 0
03 for i = 0 to 4
04   if readings[i] > 4 then
05     total = total + readings[i]
06   endif
07 next i
08 print(total)
Complete the trace
ireadings[i]Condition true?total
0
1
2
3
4

a Complete the trace table.

4 marks

b State the value printed on line 08.

1 mark

c Explain why total does not change on every pass of the loop.

2 marks

d Write a replacement for lines 03–07 using a condition-controlled loop. Keep the same output.

3 marks

OCR A-level Computer Science H446

Explain a system, rather than name its parts

Component 01: Computer systems

Specification
1.1.1(b),(c); 1.4.1(b),(e),(f); 1.4.3(a),(d); 1.5.1(a)
Marks
22
Suggested time
25 minutes
Calculator
Not permitted

A clinic uses a desktop computer to display appointment records from a local database. It can upgrade either the processor clock speed or the cache size. The current application includes many dependent instructions and repeatedly reads the same small set of records. The price of the two upgrades is equal.

Logic circuit output to complete
ABQ = A AND NOT B
00
01
10
11

a Explain the roles of the program counter and memory address register during the fetch stage of the fetch–decode–execute cycle.

4 marks

b Discuss which upgrade is more appropriate for the clinic’s computer.

9 marks

c Convert the unsigned eight-bit binary value 00101101 to denary. Show your working.

2 marks

d Convert hexadecimal 3A to denary. Show your working.

2 marks

e Complete the truth table for Q = A AND NOT B.

3 marks

f Explain one reason the clinic must restrict access to patients’ appointment records under data-protection requirements.

2 marks

More questions

H446/02 · 2.2.1(a) · No calculator · 2 marks

Write the missing statement

prices = [4, 7, 2, 5], total = 0. An inclusive loop visits i = 0 to 3. Write the assignment that adds each price to total, then state the final total.

H446/01 · 1.4.1(b) · No calculator · 2 marks

Binary working

Write 45 as an unsigned eight-bit binary number. Show place-value working.

H446/02 · 2.3.1(f) · No calculator · 2 marks

A pass, with a reason

The list is [5, 3, 8, 1]. State the list after one left-to-right ascending bubble-sort pass and explain why the final item is there.

H446/02 · 2.3.1(f) · No calculator · 1 mark

Search precondition

State one required precondition for a standard binary search of an array in ascending order.

H446/01 · 1.4.1(e),(f) · No calculator · 2 marks

Hexadecimal working

Convert hexadecimal 2F to denary. Show working.

H446/01 · 1.5.1(b) · 2 marks

Apply the law to the scenario

A former employee uses another person’s password to read a company’s computer files without permission. Name the relevant legislation and explain why it applies.

Independent practice for OCR A-level Computer Science (H446), not endorsed by OCR.

Privacy · Terms