📘 Access 10,000+ CBC Exams With Marking Schemes

Prepare your learners for success! Get CBC-aligned exams for Grades 1–9, PP1–PP2, Playgroup and High School - all with marking schemes.

Browse Exams

Instant download • Trusted by 100,000+ teachers • Updated weekly

Computer Programming Question Paper

Computer Programming 

Course:Bachelor Of Commerce

Institution: Kenyatta University question papers

Exam Year:2009



KENYATTA UNIVERSITY
UNIVERSITY EXAMINATIONS 2009/2010
FIRST SEMESTER EXAMINATION FOR THE DEGREE OF BACHELOR OF
COMMERCE
BMS 201: COMPUTER PROGRAMMING

DATE: Thursday 3rd December, 2009 TIME: 11.00 a.m. – 1.00 p.m.

INSTRUCTIONS
Attempt Question 1 and any other TWO questions.

QUESTION ONE
a)
Input to a payroll program consists of base pay rate, shift code and hours worked.
Write a program to compute an employee’s gross pay, with holding tax and net
pay and print these results. The gross pay is calculated by multiplying the hours
worked by the pay rate, where the pay rate is the product of the base pay rate and
shift factor. The shift factor comes from the following table:
SHIFT CODE SHIFT
FACTOR
0 1
1 1.25
2 1.5

The withholding tax is the product of gross pay and tax rate. The tax rate is found
in the following table:


GROSS PAY (Kshs) TAX
RATE
(%)
Less than 6000
0
6000 but less than 7500
8
7500 but less than 9000
12
9000 but less than 10500
15
10500 or more
17.5
Page 1 of 2


The net pay is computed by subtracting the withholding tax from the gross pay.










[20 marks]
b)
An organization has recently installed an in-house computer. State and explain
why you might recommend a high level language for its programming needs.










[10 marks]
QUESTION TWO
a)
Describe five programming errors in C+ +


[10 marks]
b)
Define the term flowchart. Using the following narrative construct a program
flowchart.







[10 marks]

If an order is received within ten days, a prompt reply gift is sent and the order is
entered in a grand draw. If an order is received in the next 21 days, it is merely
entered in the grand draw. If an order is received after that, a letter is sent
illustrating the missed prizes.

QUESTION THREE
a)
Differentiate between the following terms giving relevant examples:
i)
Syntax
and
Logical
errors.
[2
marks]
ii)
Source
code
and
Object
code
[2
marks]
iii)
Compiler
and
Assembler
[2
marks]
iv)
Constant
and
Variable
[2
marks]
v)
Object
and
Class
[2
marks]
b)
i)
Why is it important to declare variables before we use in C+ +
programming?





[3 marks]
ii)
Write a type definition part which defines the type suitable for the values
of the age, sex, height, weight and marital status of a person.

[5 marks]

iii)
Give the general syntax for each of the two forms of comments in C+ +










[2 marks]

QUESTION FOUR
a)
Explain what is meant by the term open source software clearly highlighting why
they are becoming increasingly popular in Kenya today.

[10 marks]
b)
Describe the program development life cycle.


[10 marks]

………………..
Page 2 of 2






More Question Papers


Exams With Marking Schemes

End Term 3 Exams

Mid Term Exams

End Term 1 Exams

Opener Exams

Full Set Exams



Return to Question Papers