0% found this document useful (0 votes)
61 views

The British Computer Society The Bcs Professional Examinations

This document provides information about an exam for the British Computer Society's Professional Examinations Certificate in Software Development. The exam is 2 hours and 30 minutes long, with Section A and Section B each worth 50% of the marks. Section A contains 4 questions and candidates must answer 2, spending about 30 minutes on each. Section B contains 8 questions and candidates must answer 5, spending about 12 minutes on each. The document provides sample exam questions for Sections A and B.

Uploaded by

Ozioma Ihekwoaba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

The British Computer Society The Bcs Professional Examinations

This document provides information about an exam for the British Computer Society's Professional Examinations Certificate in Software Development. The exam is 2 hours and 30 minutes long, with Section A and Section B each worth 50% of the marks. Section A contains 4 questions and candidates must answer 2, spending about 30 minutes on each. Section B contains 8 questions and candidates must answer 5, spending about 12 minutes on each. The document provides sample exam questions for Sections A and B.

Uploaded by

Ozioma Ihekwoaba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

THE BRITISH COMPUTER SOCIETY

THE BCS PROFESSIONAL EXAMINATIONS


Certificate
SOFTWARE DEVELOPMENT
20th April 2006, 2.30 p.m.-4.30 p.m.
Time: TWO hours

Both Section A and Section B carry 50% of the marks.


You are advised to spend about 1 hour on Section A (30 minutes per question)
and 1 hour on Section B (12 minutes per question).

SECTION A
Answer TWO questions out of FOUR.
You are advised to spend about 1 hour on Section A (30 minutes per question).
All questions carry equal marks.
The marks given in brackets are indicative of the weight given to each part of the question.

1.

A doctors patient records are stored for each complete year in a sequential file <patrec05>. Each patient record
contains the following items:
NHS number
(4 digits)
Name
(20 characters)
Category
(one from child, teenager, adult, pensioner)
Postcode of address
(8 characters)
Repeat medication needed
(Yes / No)
Number of visits to surgery
(integer)
Major illnesses code
(A or B)
Description
(20 characters)
a)

Write an appropriate description for these records in a suitable programming language. State which
language you are using.
(5 marks)

b)

A program is required to print a report which lists details of only the patients who live in a particular part of
the city, which is identified by the first four characters of the postcode, e.g. TS12, which is requested
interactively. The printed details are given under the headings below; that is,
NHS Number
1200

Name

Surgery Visits

JOE BLOGGS

32

At the end of the report the total number of patients for that part of the city is printed as well as the total number
of patient records on the file. The ratio of these is also printed as a percentage.
Write an algorithm for this program in pseudocode or structured English.
c)

(15 marks)

Develop a program for the report as described in b). Use the record description from part a) but do not copy
it out again and indicate where it belongs in your program code.
(10 marks)

Turn over]

2.

3.

a)

Dry run the algorithm below using the values a =16, d=3 and N=5.
Code
Line number
1
READ(a,d,N);
2
prod :=1;
3
a2j := a;
4
WHILE d > 0 DO
BEGIN
5
IF odd(d) THEN prod := prod*a2j MOD N;
6
d := d DIV 2;
7
a2j := SQR(a2j) MOD N
END;
8
WRITELN('result = ',prod:5)
9
END.

(15 marks)

b)

Write BRIEF notes on the use of variable identifiers and comments in the algorithm in part a).

c)

Re-write the algorithm as an integer FUNCTION called Fermat with three parameters representing a, d and
N. Incorporate in your re-written algorithm any improvements you noted in your answer to part b).
(11 marks)

a)

The array DATA has entries from index 20 to index 80 which are sorted in ascending order. The task is to
find the index position of the first repeated number which is above a certain chosen value. Write a function
called pos_rep in a programming language of your choice with a parameter min which will contain the lower
limit. The function should return the number zero if no qualifying value in DATA can be found.

(4 marks)

For example, when the DATA array contains the numbers as below then pos_rep(10) would have result 25
and pos_rep(2) would have result 21.
DATA
Index
Value

20
1

21
3

22
3

23
7

24
8

25
14

26
14

27
15

28
---

29

---(20 marks)

4.

b)

Trace the call of your coding of pos_rep with parameter 10 and with the array DATA initialised as in part a).
(10 marks)

a)

Choose either version A (written in C) or version B (written in Pascal) which perform identical operations
and then provide comments suitable for the following lines of code:
i)
line 1
ii) line 3
iii) line 4
iv) line 6
v) lines 8-10
(20 marks)
Version A
Version B
procedure a(var b, c : integer);
void a(int b, c)
1
begin
{
2
var d, e : integer
int d, e;
3
for d:=b step 1 to c-1 do
for(d=b; d<c; d++)
4
begin
{
5
if v[d]>v[d+1]
if(v[d]>v[d+1])
6
then begin
{
7
e:=v[d+1];
e=v[d+1];
8
v[d+1]:=v[d];
v[d+1]=v[d];
9
v[d]:=e
v[d]=e;
10
end
}
11
end
}
12
end
13 }

b)

It is desired to further modularise this code by making lines 8-10 into a separate subprogram (function or
procedure). Write out the subprogram and rewrite lines 8-10 to make use of your subprogram. (10 marks)

SECTION B
Answer FIVE questions out of EIGHT.
You are advised to spend about 1 hour on Section B (12 minutes per question)
All questions carry equal marks.
The marks given in brackets are indicative of the weight given to each part of the question.

5.

Write a program to merge two distinct lists into a single linked list. Both of the initial lists contain an integer and
the pointer and are both in ascending integer order. This order must be preserved in the merged list. The lists
have the same length. They are set up by the procedure setuplist(head) which returns a pointer to the head of the
list. You must not write this procedure but indicate where appropriate calls to it would be made in your code.
(12 marks)

6.

Write a program which takes as input any 4-digit year and which prints out who was then President of the United
States. Should the year precede 1933 or fall after 2005 an appropriate error message should be output. The
necessary data e.g. Clinton, 1993, 2001 may be stored on a previously written file or in DATA statements.
(12 marks)

7.

A useful series for the calculation of is due to Gottfried Liebniz (1646-1716)


= 4( 1 - 1 + 1 - 1 + l - 1 + 1 )
3 5 7
9 11 13

8.

a)

Establish a relationship between successive terms of this series.

(3 marks)

b)

Use this in a program to compute to 10 decimal place accuracy. Print how many iterations are needed:
[ = 3.1415926535]
(9 marks)

While the area of an ellipse having major axis (a) and minor axis (b) is given exactly by the formula A = *a*b
there is no formula which gives the exact perimeter(S). The best approximation is given by Ramanjuans
formula:
S (a + b) [1 + 3t / (10 + sqrt(4 -3t))] where t is given by
t = (a - b)2 / (a + b)2
Other approximations are S ( a + b) and S 2**a*b.
Write a program to compute the area for a group of ellipses having major axis (a) and minor axes between bmin
and bmax, which are requested interactively. It also computes the perimeter by each of the three given formulae,
and finds the percentage difference of the other two from that given by the Ramanjuan formula.
(12 marks)

9.

When a user is entering data on an interactive form there are several interface elements that can be used for
different kinds of data. Summarise the elements, show what they look like on the interface and describe the
type(s) of data for which they are best used.
(12 marks)

Turn over]

10. a)

Suppose that marks are available for students as follows: Anne 40, Colin 55, Daniel 44, Frank 60, George
52, Harry 70, Jill 62, Kate 39, Lynne 74. This data is to be stored in a sequential file.
i)
Draw a diagram representing the sequential file.
ii) List in order all the keys that will be visited to lookup the marks for the student Harry.
(4 marks)

b)

Now suppose that the file is made into an indexed sequential file with a single level index. The index groups
are defined by initial letter of name, with 3 initial letters per group, i.e. A-C, D-F, G-I, etc.
i)
Draw a diagram representing the file and its index.
ii) List in order all the keys that will be visited to lookup the marks for the student Kate indicating which
keys are accessed in the index and which in the main file.
(8 marks)

11. Consider the function min (see box below).


a)
b)
c)
d)

How would a black-box test of the function min be performed?


(3 marks)
How would a white-box test of the function min be performed?
(3 marks)
In what way would the error in the function show up under black-box testing using the test case min(4,2,3)?
(3 marks)
In what way would the error show up under white-box testing using the test case min(4,2,3)?
(3 marks)
int min(int a, b, c){
/* specification: find the minimum of 3 values given as parameters */
int min; /* hold the minimum value found so far */
min=a;
if(b<a)
min=b;
if(c<a)
min=c;
return(min);
}

12. a)

Consider the data shown below:

Account
Number
Age
Name

11223344

22334455

33445566

...

...

...

...

29
J.White

33
A.Black

45
N.Brown

...
...

...
...

...
...

...
...

Imagine slicing this data up into horizontal rows and using three arrays to hold the data. How might the
arrays be declared (in a programming language of your choice). How would the name and age details of a
person with a particular account number be obtained?
(6 marks)
b)

Consider the data shown below:

Account
no.
Age
Name

11223344

22334455

33445566

...

...

...

...

29
J.White

33
A.Black

45
N.Brown

...
...

...
...

...
...

...
...

Imagine slicing this data into vertical columns and using a database table to hold the data. Describe the design
of the table. How would the name and age details of a person with a particular account number be obtained?
(6 marks)

You might also like