PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS)...

14
PCHS mock April 2014/ Computer Science Paper 2 Page 1 of 14 APRIL 2014 ADVANCED LEVEL Subject/Code: Computer Science 795 Paper N° Paper 2 Examiner DZEUGANG Placide TIME ALLOWED: 2 hours INSTRUCTIONS 1. This Question Booklet is your question paper. Do not write anything therein apart from your name and candidate number 2. This Question Booklet contains nine questions. Answer any SIX questions. 3. All questions carry 20 marks each. For your guidance, the approximate mark for each part of a question is indicated in brackets. 4. You are reminded of the necessity for good English and orderly presentation in your answer. 5. In calculations, you are advised to show all the steps in your working, giving your answer at each stage. 6. Clip board, log tables, slide rules, programmable calculator, cellular phone, pager and electronic gadgets in any form are not allowed. 7. Noiseless and cordless electronic calculators may be used. 8. The Answer Sheet must be handed over to the invigilator before leaving the examination hall . TURN OVER PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) MANKON, BAMENDA

Transcript of PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS)...

Page 1: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 1 of 14

APRIL 2014 ADVANCED LEVEL Subject/Code: Computer Science 795

Paper N° Paper 2

Examiner DZEUGANG Placide

TIME ALLOWED: 2 hours

INSTRUCTIONS

1. This Question Booklet is your question paper. Do not write anything

therein apart from your name and candidate number

2. This Question Booklet contains nine questions. Answer any SIX

questions.

3. All questions carry 20 marks each. For your guidance, the approximate

mark for each part of a question is indicated in brackets.

4. You are reminded of the necessity for good English and orderly

presentation in your answer.

5. In calculations, you are advised to show all the steps in your working,

giving your answer at each stage.

6. Clip board, log tables, slide rules, programmable calculator, cellular

phone, pager and electronic gadgets in any form are not allowed.

7. Noiseless and cordless electronic calculators may be used.

8. The Answer Sheet must be handed over to the invigilator before leaving

the examination hall .

TURN OVER

PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) MANKON, BAMENDA

Page 2: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 2 of 14

Question 1

1- Determine the value of X in this equation X2 + 11012=1068 (2mks) 1068 = 10001102. So the equation become X2 + 11012=10001102

We then have X = 1000110 – 1101 1000110 - 1101

0111001 Finally, X2 = 01111012

2- Suppose you have to write an assembly program that performs the following

calculation: 𝒚 = 𝒙𝟐 − 𝟑𝟎𝒙 + 𝟏𝟔𝟏. The input x is an UNSIGNED five-bit binary

number.

(a) What is the decimal range for input x? (1 mk)

x be an unsigned 5 bit binary number, it range from 00000 to 11111then from 0 to 31

(b) What is the maximum positive value for y? (1 mk) The maximum is reached for x = 31, then y = 31²- 30x31+161

Finally y = 192

(c) What is the maximum negative value for y? (1 mk) (192)10 = (11000000)2. If y is a signed number, then the first bit is the sign bit and

then (11000000)2 will be the representation of (-64)

The maximum negative value of y is then -64

(d) How many bits will you need to allocate for the SIGNED result y? (1 mk) We will need to allocate 9 bits for y

(e) Convert your decimal answers for parts b) and c) to SIGNED 2’s complement binary.

192 is positive then it does not change in 2’s complement. It representation is 011000000

64 → 001000000 -64 → 111000000

3- In a certain coding scheme, each character occupies 7 bits. Letters of the alphabet

are assigned consecutive codes. If letter N is represented by 1010010; what is the

representation of letter A in this coding scheme? (2mks)

From A to N we skip 13 positions.

Then if (XA)10 is the of A and (XN)10 the code of N in base 10, then (XN)10 = (XA)10 + 1310

⇔(XA)10 = (XN)10 - 1310

⇔ (XA)2 = 10100102 – 11012 for (1310 = 11012)

⇔ (XA)2 = 10001012

Finally the code of A is 1000101

4- The diagram shows a cabinet designed to

house machinery. Sliding panels allow easy

access. The output Q of an electronic warning

system triggers an alarm if the enable switch

A is turned on, when either panel is open, or

both are open. Each sliding panel closes a

microswitch, when in place. The

microswitch C microswitch B

enable switch A

Page 3: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 3 of 14

microswitches, B and C, output a logic 0 signal when closed. The enable switch A sends

a logic 1 signal to the electronic system when turned on. The system outputs a logic 1 to

trigger the alarm.

(a)Draw the truth table for the logic system. (3mks)

Inputs: A, B, C Output: Q

A B C Q

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

(b)Write a Boolean expression for the output Q in terms of inputs A, B and C, and

simplify it using Karnaugh map. (3 mks)

According to the truth table above, 𝑄 = 𝐴𝐵 𝐶 + 𝐴𝐵𝐶 + 𝐴𝐵𝐶

The Karnaugh map can then be given by

AB

C

00 01 11 10

0 1

1 1 1

By well reading the Karnaugh map above, the simplified expression of Q is given by

Q=AB+AC

(c) Design a circuit of logic gates

5- A double – sided disk contains 40 tracks on each side. The tracks are divided into 9

sectors of 512 bytes each. What is the total capacity of the disk in megabytes?( 2mks)

Total tracks = (40 x 2) = 80

Total sectors = (80 x 9) = 720

Total bytes (720 x 512) = 368, 640 bytes

If 1 MB = 1,048, 576 bytes

capacity = 368, 640 bytes

capacity = 368, 640 / 1,048, 576

capacity = 0.352 MB

Page 4: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 4 of 14

Question 2

1- The following information was seen in one of the local daily newspaper.

(a) From the above advert identify the following items: (3mks)

i. Type of processor: Intel ® Duo Core

ii. Memory capacity of the computer.: 3072MB of RAM or 3.072GB of RAM

iii. Type of monitor : WXGA + TFT high brightness

(b) Which characteristics of the computer above make it a multimedia computer (2

mks)

17.0’’ TruBrite® WXGA + TFT High Brightness, Web Cam, Wi–Fi®

(c) Explain any three hardware considerations before purchasing a computer.

(3mks)

Cost: - (i) Its processing capability. (ii) Whether it is branded or a clone. Branded computers are more

expensive than their equivalent clones. (iii) Its size. Portable computers are more expensive compared to

desktop equivalent.

Warranty: It is the agreement between the buyer and the seller that spells out terms and conditions of after

selling a product in case of malfunction.

Portability:

Upgradability and compatibility: The one that can easily be upgraded to accommodate emergent technologies.

User needs: Consider the unique needs of the user. E.g. users with special disability like inability to use their

hands, consider buying input devices that capture data through voice recognition.

Monitor: The choice may depend on size, resolution and technology used to make it.

Multimedia capability

2- Study the diagram below and answer questions that follow:

(a) Identify the port shown in the diagram. (1mk)

USB (Universal Serial Bus) port

(b) Give TWO reasons why the identified port in 2(a) above finds widespread use

in computer systems. (2mks)

ii. It provides very high speed and quality data transmission over a distance of approximately 5 metres.

iii. It supports a wide range of peripheral devices ranging from external storage drives to digital cameras.

3- A computer must go through the process of booting/ initialization before use

(a) Briefly explain the term “computer booting”. (1 mk)

Refers to the process of starting up a computer i.e. the operating system is loaded into the memory of a

computer.

(b) Explain what happens in the computer during the booting process (3 mks)

BIOS routines are the first thing that begin when the computer is turned on. They are made

up of 3 main operations:

Satellite L350 – 22V

Intel® Duo Core 2.1 GHz, Genuine Windows Vista® Home Premium, 3072MB, 320GB

HDD, DVD Super Multi(Double layer) drive, 17.0’’ TruBrite® WXGA + TFT High

Brightness, Web Cam, Wi–Fi®

Page 5: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 5 of 14

- First, the Power On Self Tests (POST) are conducted. These tests verify that the

system is operating correctly and will display an error message and/or output a

series of beeps known as beep codes depending on the BIOS manufacturer.

- Second, is initialization in which the BIOS looks for the video card. In particular, it

looks for the video card's built in BIOS program and runs it.

- Third, is to initiate the boot process. The BIOS looks for boot information that is

contained in file called the master boot record (MBR) at the first sector on the disk.

Once an acceptable boot record is found the operating system is loaded which takes

over control of the computer.

(c) Explain and give the difference between the following types of booting (2 mks)

(i) Cold booting: (ii) Warm Booting

cold booting happens when a computer that was originally off is switched on by pressing

the power button on the system unit.

warm booting happens when a computer that was originally on is forced to restart by

pressing the Restart button on the System unit or by pressing a combination of keys on the

keyboard (Ctrl + Alt + Del)

(d) What is BIOS? What is its role in the computer? If you have a bootable CD-

ROM containing the original system setup, what BIOS option do you adjust if

you need to restore the system with its original software? (3 mks)

The BIOS of a PC software is built into the PC, and is the first code run by a PC when

powered on ('boot firmware'). The primary function of the BIOS is to load and start an

operating system. The order that the BIOS looks for devices can be determined in your

BIOS settings. Usually it searches in this order CD Drive, Floppy, C Drive. The BIOS

option to adjust in this case is the boot sequence option

Question 3

2- (a). The following are some of the phases in the system development life cycle (SDLC):

system analysis, system design, system implementation, system review and

maintenance. Give a brief description of any two phases. (4 mks)

1) Requirement gathering and analysis: Business requirements are gathered in this

phase. Meetings with managers, stake holders and users are held in order to determine the

requirements like; Who is going to use the system? How will they use the system? What data

should be input into the system? What data should be output by the system?

2) Design: In this phase the system and software design is prepared from the requirement

specifications which were studied in the first phase. System Design helps in specifying

hardware and system requirements and also helps in defining overall system architecture.

3) Implementation / Coding: On receiving system design documents, the work is divided in

modules/units and actual coding is started. Since, in this phase the code is produced so it is

the main focus for the developer.

Page 6: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 6 of 14

4) Testing: After the code is developed it is tested against the requirements to make sure

that the product is actually solving the needs addressed and gathered during the

requirements phase.

5) Deployment: After successful testing the product is delivered / deployed to the customer

for their use.

6) Maintenance: Once when the customers starts using the developed system then the actual

problems comes up and needs to be solved from time to time.

(b) Despite rigorous testing, it is sometimes necessary for software developers to

maintain the systems they have produced. Explain why this situation might arise

and describe, using suitable examples, two types of maintenance that might have

to be undertaken. (3mks)

- Corrective maintenance: REACTIVE modification, done in the software product

after the delivery. The purpose of corrective maintenance is to correct / or fix

discovered ( or user reported ) problems in the system

- Adaptive maintenance: a modification done after delivery, in order to keep the

software product usable in changing (or changed ) environments / business

environments . If this is not done properly by the time of change, business

opportunities will be lost.

- Perfective maintenance: a software should be efficient / less resource consuming /

and should be easy to cope with . Perfective maintenance is done in order to improve

the software performance ( after a change in the software or / the environment, the

performance of the software changes ) . Also improving the maintainability is a

concern .

- Preventive Maintenance: it is done, to detect and correct latent ( not developed )

faults before they become effective faults . This simply means the prevention of

future problems .

(c) State two methods of gathering information during system analysis stage (2mks)

- Observation

- Interview

- Survey

- meetings

(d) State two reasons why an organizations may use other strategies of software

acquisition other than developing their own. (2 mks)

it takes a long time to develop such a system, between a few months to years

it costs a great deal of money to develop such a system.

the company may need to employ a team of people such as business analysts,

programmers, testers etc

there will be little in the way of user support and online help

(e) Name three functions that the systems analyst perform during the Systems

Development Life Cycle (SDLC) (3 mks)

Page 7: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 7 of 14

- study an existing system with the aim of developing a new one or improving the

existing one

- make proposals to an organization w.r.t. equipment, personnel and business

processes

- may design new systems including both hardware and software

- coordinate tests and observe initial use of a system to ensure it performs as planned

- Prepare specifications, work diagrams and structure charts for programmers to

follow.

3- DDeevveelloopp tthhee nneettwwoorrkk aaccttiivviittyy aass aa GGaanntttt cchhaarrtt oorr PPEERRTT cchhaarrtt aanndd iiddeennttiiffyy tthhee

ccrriittiiccaall ppaatthh ffoorr aa pprroojjeecctt bbaasseedd oonn tthhee ffoolllloowwiinngg iinnffoorrmmaattiioonn.. ((66 mmkkss))

Activity A B C D E F G H I J

Expected duration 5 10 8 1 5 10 14 3 12 6

Predecessors (in days) -- A A A B, C D, E F G F H, I

Gantt chart Act.

No

2 4 6 8 1

0

1

2

1

4

1

6

1

8

2

0

2

2

2

4

2

6

2

8

3

0

3

2

3

4

3

6

3

8

4

0

4

2

4

4

4

6

4

8

5

0

A

B

C

D

E

F

G

H

I

J

PERT CHART

On the both above figure, the critical path appears in read

Question 4

1- What is the difference between kernel mode and user mode as far as operating system is

concerned? (2 mks)

1. In Kernel mode, the executing code has complete and unrestricted access to the underlying

hardware. It can execute any CPU instruction and reference any memory address. Kernel

Page 8: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 8 of 14

mode is generally reserved for the lowest-level, most trusted functions of the operating

system. Crashes in kernel mode are catastrophic; they will halt the entire PC..

2. In User mode, the executing code has no ability to directly access hardware or reference

memory. Code running in user mode must delegate to system APIs to access hardware or

memory. Due to the protection afforded by this sort of isolation, crashes in user mode are

always recoverable. Most of the code running on your computer will execute in user mode.

2- How does the distinction between kernel mode and user mode function as a rudimentary

form of protection (security) system? (2 mks)

The distinction between kernel mode and user mode provides a rudimentary form of protection in the

following manner. Certain instructions could be executed only when the CPU is in kernel mode.

Similarly, hardware devices could only be accessed only when the program is executing in kernel

mode. Control over when interrupts could only be enabled or disabled is also possible only when the

CPU is in kernel mode. Consequently, the CPU has very limited capability when executing in user

mode, thereby enforcing protection of the critical resources.

3- Which of the following instructions should be privileged? (4 mks)

a. Set value of timer.

b. Read the clock.

c. Clear memory.

d. Issue a trap instruction.

e. Turn off interrupts.

f. Modify entries in device-status table.

g. Switch from user to kernel mode.

h. Access I/O device.

4- What is the purpose of system calls? (2 mks)

System calls are like special functions that manage OS routines which live in Kernel Mode.

A system call can be called when we:

access an I/O device or a file (like read or write)

need to access privileged information (like pid, changing scheduling policy or other

information)

need to change execution context (like forking or executing some other application)

need to execute a particular command (like ''chdir'', ''kill", ''brk'', or ''signal'')

5- Consider a system with a total of 150 units of memory, allocated to three processes as shown

Process Max Hold

1 70 45

2 60 40

3 60 15

Apply banker’s algorithm to determine it would be safe to grant each of the following request. If

yes, indicate a sequence of terminations that could be guaranteed possible. If no, show the

reduction of the resulting allocation table. (6 mark)

a) A fourth process arrives with maximum memory need of 60 and initial need of 25

units.

Process Max Hold Lack

1 0 0 0

2 0 0 0

3 60 15 45

4 60 25 35

Used: 40 Avail: 110

Process Max Hold Lack

1 70 45 25

2 60 40 20

3 60 15 45

4 60 25 35

Used: 125 Avail: 25

Process Max Hold Lack

1 70 45 25

2 0 0 0

3 60 15 45

4 60 25 35

Used: 85 Avail: 65

Page 9: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 9 of 14

Process Max Hold Lack

1 0 0 0

2 0 0 0

3 60 15 45

4 0 0 0

Used: 0 Avail: 150

All the processes terminate, there are in safe state.

b) A fourth process arrives with maximum memory need of 60 and initial need of 35

units.

Each process needs at least 20 units of memory to finish and only

15 units are available. There is not any allocation which can

enable processes to be terminated. They are then in unsafe state.

6- What is a file system? Show the difference between NTFS and FAT 32 file systems (4 marks)

A file system is a way of organizing information on a storage device like a computer hard drive.

Common file systems include NTFS, FAT,

Question 5

1- What is a memory hierarchy? Describe the problem a memory hierarchy solves and

explain why it works so well. (3 mks)

2- A printer fails to work as expected when a document is sent to be printed. The user has

checked that the on-line light of the printer is on and the printing paper is correctly

inserted. Give TWO other possible reasons why the printing process failed. (2 mks)

3- With reference to disk management explain what is meant by the terms below.(3

mks)

i) Formatting: Preparing disks for data storage by creating sectors and tracks on the

disk surface.

ii) Defragmentation: The rearrangement of scattered files on a storage media in order

to speed up access to files.

iii) Disk partitioning : The process of dividing a large physical disk into two or more

portions / logical drives or volumes.

4- What is a mass memory device? Name and explain any two mass memory device (3

mks)

Refers to various techniques and devices for storing large amounts of data.

floppy disks : Relatively slow and have a small capacity, but they are portable,

inexpensive, and universal.

Process Max Hold Lack

1 0 0 0

2 0 0 0

3 60 15 45

4 0 0 0

Used: 15 Avail: 135

Process Max Hold Lack

1 70 45 25

2 60 40 20

3 60 15 45

4 60 35 35

Used: 135 Avail: 15

Page 10: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 10 of 14

hard disks : Very fast and with more capacity than floppy disks, but also more expensive.

Some hard disk systems are portable (removable cartridges), but most are not.

optical disks : Unlike floppy and hard disks, which use electromagnetism to encode data,

optical disk systems use a laser to read and write data. Optical disks have very large storage

capacity, but they are not as fast as hard disks. In addition, the inexpensive optical disk drives

are read-only. Read/write varieties are expensive.

tapes : Relatively inexpensive and can have very large storage capacities, but they do not

permit random access of data.

5- (a) What is the difference between interrupt and pooling? (2 mks)

Polling the device usually means reading its status register every so often until the device's

status changes to indicate that it has completed the request. An interrupt driven device driver

is one where the hardware device being controlled will cause a hardware interrupt to occur

whenever it needs to be serviced.

When you do a polling, it means you are regularly checking that a bit is set or not. This takes

time and you can do a lot of things before checking again and see that the bit actually

changed.

When working on interruption, the program continues running and do anything it wants and

when the event occurs, your software is stopped and execute the interrupt to deal with the

event. It means you react immediately to the event and that you don't need to check if the bit

is set or not.

With interrupt, you have a better reaction time as the event triggers the interrupt.

With polling, you are talking CPU load to do a check that are usually not met, until the check

works.

It a bit like if a phone with a ring and a phone without a ring:

Polling means that you pick up the phone regularly to see if someone is on the other end.

Interrupt means you can do what you want and the phone will ring to interrupt you when

someone arrives on the other end.

(b) What is Non-Maskable Interrupt? Give an example (2 mks)

A non-maskable interrupt (NMI) is a hardware interrupt that cannot be ignored by

standard interrupt masking techniques in the system. It is typically used to signal

attention for non-recoverable hardware errors. A non-maskable interrupt is an interrupt

that cannot be turned off globally by software. Example: the reset button on their

computer

6- What is the von Neumann bottle neck? Explain how the problem is solve while using

a system bus architecture (3 mks)

Instructions and data have to be fetched in sequential order (known as the Von Neuman

Bottleneck), limiting the operation bandwidth.

7- Explain any of the following input technology: OCR, OMR, MICR (2 mks)

Page 11: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 11 of 14

a) MICR: MICR is a character recognition technology used primarily by the banking

industry to facilitate the processing of cheques. The human readable characters are

printed on documents using a magnetic ink. It stands for Magnetic Ink Character

Recognition.

b) OMR: OMR which stands for Optical Mark Recognition is the process of gathering

data with an optical scanner by measuring the reflectively of light at predetermined

positions on a surface.

c) OCR: OCR stands for Optical Character Recognition. OCR is the recognition of

printed or written text characters by a computer. It is the application software that

allows a computer to recognize printed or written characters, e.g. letters, numbers,

punctuation marks, and pictograms using an optical scanner for input. OCR is being

used by libraries to digitize and preserve their holdings.

d) OBR: It stands for Optical Bar Code Reader which is used for reading bar-coded

data. It scans a set of vertical bars of different width for specific data and is used to

read tags. Bar code reading is done by a light pen or scanner connected to a

computer.

OMR application: Marking of multiple choice examination answer sheets.

OCR application: Scanning of document to be edited on a computer.

MICR application: Banking, for cheque processing.

Question 6

1- What is data validation? If some data passes a validation check does this mean that

the data is correct? Explain. (3 mks)

data validation is the process of ensuring that a program operates on clean, correct and

useful data. A validation check does not make sure that data has been entered correctly. It

only ensures that the data is sensible. For this reason validation checks are not usually as

effective as verification checks. They can however be carried out automatically by a

computer and therefore require less work by computer operators making them cheaper to use

2- Some data is being entered into a database. Suggest the most appropriate validation

checks that could be used for each of these fields : (3 mks)

a) Month of the Year b) Gender c) Postcode

Field Name Type Valid Data Invalid Data

Date of Birth Format check 11/03/96 30/02/76, fred

Gender Length check, range check M, F 123, WA2

Postcode Format check, length check W12 6BD

Notice that a type check is not a very good validation check. Many of the entries in the

Valid Data column in the table pass the type check but are clearly incorrect.

Page 12: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 12 of 14

3- What is Dual input verification? Give an example of situation where it is used. If

some data passes the Dual Input verification test does that mean that it has

definitely been entered correctly ? Why ? (3 mks)

Dual Input : This method is used when data is entered at the keyboard. The data to be

entered is typed in twice by two different operators. The two copies of the data are then

compared. Any differences are detected. The operators will be prompted to retype the

sections that differ until both copies agree. When the two copies agree it is assumed by the

computer that the data has been entered correctly.

4- Explain the concept of distributed database and give two advantages. (3 mks)

This is a decentralized way of data processing. Databases are shared.

(ii) State any three advantages of distributed systems. (3 marks)

- Databases are shared. - There is no need of a big central computer.

Processing is fast since people process their own work.

5- Study all the functional dependencies and normalise the following data taken from a

student assessment form, bearing in mind that students will take a number of modules:

Student Number, Student Name, Student Address, Module Code, Module Name,

Module Mark, Module Grade (6 mks)

6- It is advisable to ‘enforce referential integrity’ when creating a relationship. When

creating a relationship, what do you understand by the term referential integrity?

(2 mks)

It is used to ensure consistence between related tables. It establishes a parent-child relationship between

tables. A foreign key is defined on a column to declare this constraint.

Question 7

1- Let’s a and b denote positive integers. Suppose a function Q is defined recursively as

follow: Q(a,b) = 0 𝑖𝑓 𝑎 < 𝑏

𝑄 𝑎 − 𝑏, 𝑏 + 1 𝑖𝑓 𝑏 ≤ 𝑎

(a) Find the value of Q(2, 3) and Q(14,3) showing the intermediate steps to your answer (6 mks)

(b) What does this function do? (2mks)

(c) Write a recursive function which calculate Q(n,m) (3mks)

2- (a) What is an abstract data type? (1 mk)

An abstract data type is a type with associated operations, but whose representation is

hidden.

(b) Choose two of the following ADTs, Explain their functioning, state and explain two

operations used and their signature: Queue, Stack, Vector, Link list (6 mks)

3- Explain overflow and underflow conditions of a stack with examples. (2 mks)

When it comes to its limit and yet another operation tries to PUSH data onto the stack then a

'stack overflow' occurs. If the stack is empty and yet a POP operation is attempted, this is

called an 'stack underflow' and can cause a program to crash.

Page 13: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 13 of 14

Question 8

1- Write down the output what would be generated by the following program segment. (2 mks)

sentinel ← 1

repeat

Sentinel ← sentinel + 1;

Write (sentinel);

Until (sentinel = 9);

2- What would happen to the programs execution if the statement ‘sentinel ← sentinel + 1;’

was changed to ‘Sentinel ← sentinel – 1? (2 mks)

3- Draw a program flowchart from the above algorithm segment (2 mks)

4- Define and differentiate the following concepts (6 mks)

a) Procedural programming and modular programming

Procedural programming is a computer programming technique in which the program is

divided into modules like function or subroutine or procedure or subprograms, where as ...

"Modular Programming" is the act of designing and writing programs as interactions among

functions that each perform a single well-defined function, and which have minimal side-

effect interaction between them. Put differently, the content of each function is cohesive, and

there is low coupling between functions as happens in procedural programming.

b) Top-down design and bottom-up design

A top-down approach (also known as stepwise design and in some cases used as a synonym

of decomposition) is essentially the breaking down of a system to gain insight into its

compositional sub-systems.

A bottom-up approach is the piecing together of systems to give rise to more complex

systems, thus making the original systems sub-systems of the emergent system. Bottom-up

processing is a type of information processing based on incoming data from the environment

to form a perception.

c) Call by value and call by reference

In the call by value method, the called function creates a new set of variables in stack and

copies the values of the arguments into them.

In the call by reference method, instead of passing values to the function being called,

references/pointers to the original variables are passed.

5- Define the term reusability and portability and explain how each is considered as an

advantage of modular programming (4 mks)

The term portability refers to the ability of a software unit to be ported (to a given

environment). A program is portable if and to the degree that the cost of porting is less than

the cost of redevelopment.

Page 14: PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) …data.over-blog-kiwi.com/0/64/15/65/20140422/ob_17a569_cs... · 2019-09-02 · PCHS mock April 2014/ Computer Science Paper 2 Page 3

PCHS mock April 2014/ Computer Science Paper 2 Page 14 of 14

bility of a item that allows it to be used repeatedly unlike a disposable item. A program

module can be reused in programs. This is a convenient feature because it reduces redundant

code. Modules can also be reused in future projects. It is much easier to reuse a module than

recreate program logic from scratch.

6- Explain the principle of binary search. Formulate the sequence of steps of that will be

followed to pick the value 80 from the following sequence using the binary search

technique. 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 (4 mks)

Question 9:

1- (a) Give the name of the communication media

depicted in the diagram below. (1mk)

Satellite

(b) Give names to the parts indicated by A,B,C,and D (4mks)

A — satellite in space

B- Downlink

C- Uplink

D- Receiving earth station

(c) List two advantages of the communication media above. (2mks)

-Eliminates the need to keep on moving the parabolic dish in a bid to track the line of sight.

- It offers a large constant line of sight to earth stations

- The satellites transmits the signal to many recipient earth stations forming a point-

to

multipoint transmission.

2- Explain the role of the following on a network. (2mks)

i) A router

ii) A gateway

3- What is meant by collision in LAN? Explain how collision is handle in a CSMA/CA

Technology (3 mks)

4- What are the advantages of FDDI over a basic Token Ring in term of robustness? (2 mks)

5- Your principal is intending to install a simple Internet connection in the school. List

down and explain three equipment/ services that he’ll require to achieve this (3 mks)

6- Explain how each of the following internet services is carried out and give and example

of tool used in each case. (3 mks)

i) Internet relay chat ii) VoIP iii) research

Your success is in Jesus-Christ!!!