Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 24 pages
Exam (elaborations)

Computer Science Paper 4 Further Problem-solving and Programming Skills 9608-04 Comprehensive Questions (Frequently Tested) with Verified Answers Graded A+ (2)

Document preview thumbnail
Preview 3 out of 24 pages

Computer Science Paper 4 Further Problem-solving and Programming Skills 9608-04 Comprehensive Questions (Frequently Tested) with Verified Answers Graded A+ (2)

Content preview

Cambridge International Examinations
Cambridge International Advanced Subsidiary and Advanced Level




COMPUTER SCIENCE 9608/04
Paper 4 Further Problem-solving and Programming Skills For Examination from 2015
SPECIMEN PAPER
2 hours
Candidates answer on the Question Paper.
No Additional Materials are required.


READ THESE INSTRUCTIONS FIRST

Write your Centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.

Answer all questions.
No marks will be awarded for using brand names for software packages or hardware.
No calculators allowed.

At the end of the examination, fasten all your work securely together.
The number of marks is given in brackets [ ] at the end of each question or part question.




This document consists of 15 printed pages and 1 blank page.


© UCLES 2012 [Turn over

, 2

Throughout the paper you will be asked to write either pseudocode or program code.

Complete the statement to say which high-level programming language you will use.

Programming language used: ............................................


1 (a) Complete the algorithm, written in pseudocode, for a binary search.
The data being searched is stored in the array SearchData[63]. The item of data being
searched is stored in the variable SearchItem.

X  0
Low  1
High  ………………………………………
WHILE (High>=Low) AND (…………………………………………………)
Middle  INT((High + Low)/2)
IF SearchData[Middle] = SearchItem
THEN
X  Middle
ELSE
IF SearchData[Middle] < SearchItem
THEN
Low  Middle + 1
ELSE
IF SearchData[Middle] > SearchItem
THEN
……………………………………………………………………
ENDIF
ENDIF
ENDIF
ENDWHILE [3]


(b) (i) The binary search only works if the data in the array being searched is:

[1]

(ii) The maximum number of comparisons that are required to find an item which is present
in the array SearchData is:

[1]

(iii) At the end of the algorithm, the variable X contains:

either the value which indicates

or the value which indicates [4]




© UCLES 2012 9608/04/SP/15

, 3

(c) You will change the binary search algorithm to a recursive algorithm and write the equivalent
program code in the form of a procedure. Name the recursive procedure BinarySearch.

Use these variables.

Variable Data Type Description

SearchData ARRAY[63] : INTEGER global array

SearchItem INTEGER global variable

X INTEGER global variable

Low INTEGER parameter

High INTEGER parameter

Middle INTEGER local variable

Write program code for the recursive procedure BinarySearch.




[5]


(d) Write the initial call to the recursive procedure.

[1]




© UCLES 2012 9608/04/SP/15 [Turn over

Document information

Uploaded on
May 18, 2026
Number of pages
24
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
0
Items
338
Last sold
-


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions