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

Gweru diocese Comp paper2

The document outlines the structure and requirements for the Zimbabwe School Examinations Council's Computer Science practical examination for Advanced Level, including three sections with specific tasks. Candidates must provide printed answers, include necessary information in the header, and back up work on a CD. The exam covers topics such as logic circuits, programming algorithms, database design, and pseudocode, with detailed instructions for each section.

Uploaded by

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

Gweru diocese Comp paper2

The document outlines the structure and requirements for the Zimbabwe School Examinations Council's Computer Science practical examination for Advanced Level, including three sections with specific tasks. Candidates must provide printed answers, include necessary information in the header, and back up work on a CD. The exam covers topics such as logic circuits, programming algorithms, database design, and pseudocode, with detailed instructions for each section.

Uploaded by

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

ZIMBABWE SCHOOL EXAMINATIONS COUNCIL

General Certificate of Education Advanced Level

COMPUTER SCIENCE 6023/2


PAPER 2 Practical

July SESSION 2023 3 hours

Additional
materials:
CD

TIME 3 hours

INFORMATION FOR 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 a candidate prints on more than one sheet,
fasten together with string. All answers should be correctly and clearly numbered.

______________________________________________________________________________
This specimen paper consists of 6 printed pages and 2 blank pages.

Copyright: Zimbabwe School Examinations Council, Specimen Paper.


2
Section A [20 marks]

Answer one question from this section.

1 (a) A safety system uses the inputs from three sensors A,B and C.The binary values from
these sensors form the input to a logic circuit.

Sensor A
Sensor B Logic circuit ‘X’ Output X from logic circuit
Sensor C

The output ,X, from the logic circuit is 1 if:


 either A is 1 and B is 1
 or A is 0 and C is 1
 or B is 0 and C is 1

(i) draw the logic circuit, to represent the above System [7]

(ii) Complete the truth table for the system [4]

(iii) Write the following statement as a logic statement:

X is 1 if A and B are on or if B is off and C is on [2]

(b) With illustrations, show an understanding of the following addressing modes:


Direct, Indirect, Indexed, and Relative. [8]

2. (a) Produce a flowchart showing the 3 stages of the straight line sequencing
of the fetch-execute cycle, describing each stage [8]

(b) Consider the truth table:


A B C X
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1

(i) Draw a logic to represent the given truth table


[6]
Each logic gate should have maximum of two inputs. Do not simplify the
logic circuit.
(ii) Write the logic expression for the given truth table [4]

(c) Draw a simplified and well-labeled diagram showing the structure of


a processor architecture, indicating the three buses [4]

.

PAPER 6023/2
Section B [50 marks]
Answer one question from this section.

3. (a) Factorial is a mathematical function which is defined as follows:

Factorial of n = n* factorial of n – 1
If n > 1

Otherwise factorial of 0 = I

This function is defined for all positive integers’ i.e whole numbers
greater or equal to zero.

Code a recursive function which returns the factorial given a positive


integer argument. [8]

(b) A taxi firm charges £3 for the first mile and £2 for every mile after that.
If there are 5 or more passengers, an extra 50% is added to the price.

(i) Write an algorithm in pseudo code which calculates the cost of a journey. [7]

(c) The names of patients are stored in the one-dimensional (1D) array Patient[ ] of type string. A
separate two-dimensional (2D) array Readings[ ] stores the latest data recorded about each patient.
The array already contains the readings taken by a nurse for each patient:
 temperature measured to one decimal place
 pulse rate, a whole number.

Temperature readings should be in the range 31.6 to 37.2 inclusive.


Pulse readings should be in the range 55.0 to 100.0 inclusive.

The hospital number given to the patient is used for the index on both arrays, this is a
value between 1 and 1000 inclusive.

When the data for a patient is checked a warning is given if any of the readings are out of
range. If both readings are out of range, then a severe warning is given.

Write a procedure, using pseudocode or program code that meets the following requirements:
 takes the hospital number as a parameter
 checks if the number is valid
 outputs an error message and exits the procedure if the number is not valid
 if the hospital number is valid:
– output the patient’s name
– output ‘Normal readings’ if both the readings are within range
– output ‘Warning’ and the name of the reading e.g. ‘Pulse’ if one reading is out of
range
– output ‘Severe warning’ and the names of the two readings ‘Pulse and
temperature’ if both readings are out of range
– exits the procedure.

You must use pseudocode or program code and add comments to explain how your code works.
You do not need to initialise the data in the arrays. [15]
(d) Write a program code to implement a bubble sort algorithm to input 10
integer elements in an array and sort them in a descending order.

Use a text editor to type the program code. [25]

4. Write a Vb.Net program to search an array element from the array


of integers, 7 12 56 62 89 96 . Assume that search element is 62.
Your output should display: “Found element 62 at position 3. [10]

(b) A company selling consumer products is developing a promotion campaign


that will apply a certain discount to the total sales amount of all products in a
sales bucket. The discount is based on blocks of total sales amounts, as follows:

Total Amount less 50: 0%


Total Amount between 50 and 100: 5%
Total Amount between 101 and 200: 10%
Total Amount above 200: 15%

There is a sales tax of 15% imposed on the discounted total amount greater than equal to
150.
You are required to design an appropriate form with the required controls, and write code
to the following:
 Read the total Amount from a text box.
 Use a SELECT CASE structure to find the appropriate discount percentage, and
compute the Discount Amount accordingly
 Compute the Discounted Total Amount
 Use an IF… statement to find the appropriate tax rate and apply it on the
Discounted Total Amount to compute the Tax Amount.
 Compute the After-Tax Discounted Total Amount

 Display the following on appropriate output textboxes, all amounts formatted as


currency, with two decimal places .Discount Amount. Discounted Total Amount.
Tax Amount. After-tax Discounted Amount.
 Re-initialize the interface after calculation and exit program
(i) Design the user interface for the program [10]
(ii) Write the program corresponding to the user interface [30]

Section C [30 marks]

Answer one question from this section.

5. (a) In the company:


• An employee can be a manager.
• A department can have several managers and several employees.
• An employee can only belong to one department.

The EMPLOYEES database has three tables:

EMPLOYEE_DATA (EmployeeID, FirstName, LastName, DateOfBirth, Gender,


Department Number)

DEPARTMENT (DepartmentNumber, DepartmentName)


DEPARTMENT_MANAGER (DepartmentNumber, EmployeeID, role)

Complete the entity-relationship (E-R) diagram for the EMPLOYEES database.

EMPLOYEE_DATA

DEPARTMENT
DEPARTMENT_MANAGER

(i) Give three reasons why the EMPLOYEES database is fully normalized. [3]
(b) Part of the EMPLOYEE_DATA table is shown.

EmployeeID FirstName LastName DateOfBirth Gender DepartmentNumber


156FJEK Harvey Kim 12/05/1984 Male S1
558RRKL Catriona Moore 03/03/1978 Female F2
388LMDV Oscar Ciao 01/01/1987 Male F2

(i) Write a Data Definition Language (DDL) statement to create the EMPLOYEES
database. [2]
(ii) Write a DDL statement to define the table EMPLOYEE_DATA,and declare
EmployeeID as the primary key. [5]
(iii) Write a Data Manipulation Language (DML) statement to return the first name
and last name of all female employees in the department named Finance. [5]

(b) SomeshopsbelongtotheRainbowRetailbuyinggroup.Theybuytheirgoodsfromoneormo
resuppliers.

Each shop has:

Each shop has:

• A unique shopID
• A single retail specialism(for example, food, electrical, garden).

Each supplier has:

• A unique supplierID
• A similar single specialism recorded.

Rainbow Retail creates a relational database to record data about the shops and their
suppliers.

The entity relationship (ER) diagram for the relationship between the SHOP and
SUPPLIER tables is shown.

SHOP SUPPLIER

(i) Explain what the degree of relationship is between the entities


SHOP and SUPPLIER . [2]

The database design is as follows:


SHOP(ShopID, ShopName, Location, RetailSpecialism)
SUPPLIER(SupplierID, SupplierName, ContactPerson, RetailSpecialism)
SHOP-SUPPLIER(ShopID, SupplierID)
The SHOP–SUPPLIER table stores the suppliers that each shop has previously used.
Primary keys are not shown.
(c) (i) Label the entities and draw the relationships to complete the revised E-R diagram.

SUPPLIER

[3]
(iii) Complete the following table to show for each database table:
• the primary key
• the foreign key(s) (if any):
° Each table may contain none, one or more foreign key(s).
° For a table with no foreign key, write ‘None’.
• an explanation for the use of any foreign key.

Table Primarykey Foreignkey(s Explanation


)(ifany)

SHOP

SUPPLIER

SHOP–
SUPPLIER
[5]
(iv) The database designer has implemented SUPPLIER. ContactPerson as a secondary
key.
Describe the reason for this. [2]
(v) Write an SQL query to display the shop ID and location of all shops with a
‘GROCERY’ specialism. [3]
(vi) The existing shop with ID 8765 has just used the existing supplier SUP89 for
the first time. [3]
6. (a) Using SQL create the following table.

Table: Member
[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]
PAGE

You might also like