Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 3 fuera de 24 páginas
Examen

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
Vista previa 3 fuera de 24 páginas

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

Vista previa del contenido

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

Información del documento

Subido en
18 de mayo de 2026
Número de páginas
24
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$16.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
1
Seguidores
0
Artículos
338
Última venta
-


Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes