1
ZIMBABWE ARMY EDUCATION CORPS
General Certificate of Education Advanced Level
COMPUTER SCIENCE 6023/2
PAPER 2 Practical
JUNE/JULY 2019 SESSION 3 hours
Additional materials:
CD
Printing Facility
Time: 3 hours
INSTRUCTIONS TO CANDIDATES
This is a purely practical examination. All answers should be printed. Handwritten answers will not be
marked.
This paper consists of three sections.
Section A 20 marks
Section B 50 marks
Section C 30 marks
Answer one question from each section.
Each answer sheet should include the following information in the header section:
Candidate Name
Centre Name and Date
Subject Code
When answering programming questions, indicate the language used.
All work should be backed up by a soft copy on a CD. If a candidate prints on more than one sheet, fasten
together with string.
All answers should be correctly and clearly numbered.
INFORMATION FOR CANDIDATES
The number of marks is given in brackets [ ] at the end of each question or part question.
This question paper consists of 6 printed pages
Copyright: Zimbabwe Army Education Corps Examinations, J2019
Computer Science 6023/2 ©ZAEC J2019
©ZAEC J2019
2
Section A [20 Marks]
Answer any ONE question from this section.
Question 1
A power station has a safety system controlled by a logic circuit. Three inputs to the logic
circuit determine whether the output, S, is 1. When S = 1 the power station shuts down. The
following table describes the conditions being monitored.
Parameter description Parameter Binary vale Description of condition
0 Gas temperature <= 160oC
Gas temperature G
1 Gas temperature > 160oC
0 Reactor pressure <= 10 bar
Reactor pressure R
1 Reactor pressure > 10 bar
0 Water temperature <= 120oC
Water pressure W
1 Water temperature >120oC
Output, S, will generate a value of 1, if:
Either water temperature >120oC AND gas temperature <= 160oC OR gas temperature >160oC
AND reactor pressure > 10 bar OR reactor pressure > 10 bar
a) Draw a logic circuit to represent the above scenario. [5]
b) Complete the truth table below of this system. [4]
INPUTS Working Space OUTPUT
W G R S
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Computer Science 6023/2 ©ZAEC J2019
3
c. Using a spreadsheet or otherwise, simulate the following logic circuit.
Print the spreadsheet with the formulas and the completed truth table with
immediate results. [11]
Question 2
a. Draw a well labelled diagram showing the Main Memory, Control Unit (CU), the
following buses: Address Bus, Data Bus and Control Bus; the following registers:
Program Counter (PC), Memory Address Register (MAR) and Current Instruction
Register (CIR); with arrows showing the flow of information during the interrupt
cycle. [14]
b. Given the following logic statement
X=1 if (A is ON and B is OFF) or (B is ON and C is OFF) or (C is On)
Draw the logic circuit. [6]
Computer Science 6023/2 ©ZAEC J2019
4
Section B [50 Marks]
Answer any ONE question from this section
Question 3
a. Mr Mundozi wants to store names of computer students and their marks obtained in two
tests as shown below:
Name Test1 Test2 Average Grade
Murutsi Roswiter 56 89 72.5 Credit
Tarimbo Tongai 49 52 50.5 Pass
Marimbi Jeredza 89 76 82.5 Distinction
Rinondo Walsea 43 54 48.5 Fail
Chesuya Connie 72 98 85 Distinction
Write a program that will accept the given records of Mr Mundozi’s students as given
above. The Name, Test1 and Test2 must be entered through the keyboard. Average and
Grade must be calculated using functions. Average is found after adding the two tests and
dividing the result by 2 (two). Grade is obtained using the following criteria:
80 – 100 = Distinction
60 – 79 = Credit
50 – 59 = Pass
0 – 49 = Fail
The program must display the output in the format given above. [20]
b. Given the following list of elements
Numbers
45 89 55 98 15 77 26
Using pseudo codes write
i. A bubble sort algorithm that can be used to arrange the elements in a descending
order. [5]
ii. A linear search algorithm that can be used to find an element in the list. If the
element is not there, the algorithm must notify the user otherwise it must display
the found element. [7]
c. Write a program that will initialise the array elements in (b) above. Convert the bubble sort
algorithm to become part of the program that will be used for sorting the elements. The
program must display the elements before sorting, during sorting and after sorting.
[18]
Computer Science 6023/2 ©ZAEC J2019
5
Question 4
a. Produce a binary tree from the following given names
James, Gary, Daison, Gerwyn, Maureen, Everisto, Natty, Adelaide, Kiven, McAsh
[10]
b. Traverse the produced binary tree using in-order travsersal. [2]
c. Write a program that will output the following pattern
A
A B
A B C
A B C D
A B C D E F
A B C D E F G
A B C D E F
A B C D E
A B C D
A B C
A B
A [14]
d. Write a program that will accept a whole number. The program must determine whether
the entered number is a Pronic/Heteromecic number or not.
[A Pronic or Heteromecic number is any number which is a product of two
consecutive integers, that is a number of the form 𝒏(𝒏 + 𝟏), e.g 72 is a pronic number
since it is the product of 8 and 9; i.e. 𝟖 ∗ 𝟗 = 𝟕𝟐]. For your test data use 65 and 30
[10]
e. Using a recursive function write a program that will display the first ten terms of the
Fibonacci series. [6]
f. Write a program that will accept a whole number in radix (base) 10 and it will convert it
to radix 2. The program must display the entered number and the radix 2 equivalent such
as: Entered number = 8 and in radix 2 = 1000. [8]
Computer Science 6023/2 ©ZAEC J2019
6
Section C [30 marks]
Answer any ONE question from this section
Question 5
Using an appropriate application, write SQL statements to perform the following
a. Create a table called “Products” with the following table structure
Field Name Datatype Field size
StockCode Integer 13
StockName Text 30
PackSize Integer 4
Price Number 4
OnHandQty Integer 6
NB the StockCode is the primary key. [14]
b. Display StockCode, StockName and Price of all Products with On hand quantity
greater than zero (0). [6]
c. Insert the following record
100002 Sazie’s Chompkins 1 6.50 20 [6]
d. Delete a product with whose StockCode equals to 100018 [4]
Question 6
a. At ABC High School, a teacher teaches many subjects. A student enrolls in many
subjects and attends four lessons per week for each subject. Each subject is taught by
several teachers. Draw an entity-relation diagram to show relationships between the
entities. On the diagram, show the primary key and at least one attribute for each entity.
[15]
b. (i) Draw a well-labelled diagram showing the different views of the Database
Management System Structure. [8]
(ii) Using examples, describe the different views of the Database Management System.
[7]
END
Computer Science 6023/2 ©ZAEC J2019