ZIMBABWE SCHOOL EXAMINATIONS COUNCIL
General Certificate of Education Advanced Level
COMPUTER SCIENCE 6023/2
PAPER 2 Practical
NOVEMBER 2021 SESSION 3 hours
Additional materials:
CD for each candidate
Printing facility
Bond paper
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 and Candidate Number
• 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 you print 011 more than one sheet, fasten the sheets together.
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 and 2 blank pages.
Copyright: Zimbabwe School Examinations Council, N2021.
©ZIMSECN2021 [Turn over
2
Section A [20 marks]
Answer anyone question from this section.
1 A boiler (B) will be ON if:
- the timer (C) is ON and temperature sensor (T) is OFF
OR
- Timer (C) is OFF and frost sensor (F) is ON.
(a) Deduce the
(i) Boolean statement; [3]
(ii) Boolean expression. -[3]
(b) Draw a logic circuit for the system. [S]
(c) Produce a truth table for the system. [4]
(d) Draw a simplified and well-labelled diagram of a Havard Computer
architecture. [S]
2 (a) Using a suitable application software package, draw diagrams to
illustrate the following addressing modes:
(i) Direct
(ii) Indirect
(iii) Immediate
(iv) Indexed
(v) Relative [IS]
(b) Identify the logic gates described below and draw the symbol and type
the logic expressions that .
(i) produce a high output when the number of high inputs is odd;
(ii) produce a high output when all of its inputs are identical. [S]
6023/2 N2021
3
Section B [50 marks]
Answer anyone question from this section.
3 (a) Study the pseudocode below.
10 FUNCTION Myfunction (BYV AL x : INTEGER): LONG
20 IF x > 0 THEN
30 Myfunction = x * Myfunction ex - 1)
40 else IF x = 0 THEN
50 Myfunction = 1
60 ELSE'
70 Myfunction = 0
80 END IF
90 END IF
100 END FUNCTION
(i) Produce a trace table (or otherwise) for the function call
Myvalue = Myfunction. (5)
to show how the final value is assigned to the return value. [6]
(ii) Identify the line number which shows this algorithm and explain
~. ~
(iii) Re-write the algorithm using iteration to perform the same task. [10]
(b) Write an algorithm using pseudocode or otherwise that accepts 30 integers
into an array and then outputs the following statistical data:
(i) mean (average of the number) [6]
(ii) whether or not the mean value is part of the data that was input by
the user
Note
L~ xi
mean=~ a sum of all the numbers
n
input divided by the
number of
numbers (count of numbers)
[8]
6023/2 N2021
[Turn over
4
(c) PaGumbo Travel Agency runs an airline for its clients. For a particular
flight, the agency charges $1000.00. They offer discounts using the
following criteria in the same order of precedence.
1. ZIMSEC candidates get 20% discount.
2. Advance bookings are granted a further 15% discount on any
amount charged.
Construct a flowchart for the calculation of airfares due to clients. [8]
(d) Using a programming language of your choice, write (code) the
declaration and initialisation of a 2-dimensional array of characters with
the character 'X'. [8]
(e) Write a line of code that will ensure that if a user input a string, only the
first character is taken. [2]
4 Xolani is a programmer at ABC Building Contractors. He is required to develop a
program to calculate employee wages at the end of each week. The program is
expected to collect the following information from the user.
Employee Name
Number of hours worked
The program then computes and outputs the following information.
Normal pay
Overtime pay
Tax
Gross pay
Net pay
After calculating pay for one employee, the program should re-initialise the
interface for the next employee's details to be accepted and processed.
Notes
Normal working hours 40
Normal rate per hour $8.00
Overtime rate per hour $12.00
Tax rate (Overtime not taxed) 10.00%
(a) Design a user interface for the program. [10]
(b) Write the program corresponding to the user interface in part (a) that
fulfils the requirements of the system. [30]
(c) Write a program that accepts 200 characters and then determines the following:
the number of capital letters
the number of vowels
the number of consonants [10]
6023/2 N2021
5
Section C [30 marks]
Answer anyone question from this section.
5 The diagram below is an entity-relationship diagram for an Examinations Database.
Results
Examination ERD
(a) Write SQL code to create the tables in a database represented in the
Examinations ERD. [17]
(b) (i) Write SQL statements to display all fields in the examAttenders
table for a student identified by StudentNo = ROO13. [3]
(ii) Write SQL statement(s) to delete Computer Science Paper 4 from
the examination table. [3]
(iii) Write SQL statements to add a duration field in the examination
table. [3]
(iv) Write SQL statement(s) to change score for ResultNo 138
from 70 to 95. [3]
(c) Suggest a key that could be used to establish the link between
Examinations and Results tables. [1]
6023/2 N2021
[Turn over
6
6 (a) Using SQL create the following table.
Table: Member
Field Datatype Size
MemberID text 10 characters
MembSurname text 5 characters
MembName text 35 characters
MembDOB date
MembRank numenc integer 3 digits [10]
(b) Write down an SQL statement to make the MemberID field the primary key. [2]
(c) AutoShop is a company that services motor vehicles. Each car has an owner
and a person may own more than one vehicle. Each car may be serviced
several times, each service is identified by a jobID.
(i) Draw an ER diagram in 2NF for this database system. [7]
(ii) Suggest table listings to store data about
cars
car owners
to match your design in (i) above, showing how the relationship
between two entities is established. [8]
(iii) Suggest any three other attributes for the service (other than jobID)
and their datatypes in a table listing. [3]
6023/2 N2021