Get premium membership and access revision papers, questions with answers as well as video lessons.
Bachelor Of Science (Computer Science) Question Paper
Bachelor Of Science (Computer Science)
Course:Bachelor Of Science In Computer Science
Institution: Masinde Muliro University Of Science And Technology question papers
Exam Year:2009
(University of Choice)
MASINDE MULIRO UNIVERSITY OF
SCIENCE AND TECHNOLOGY
(MMUST)
UNIVERSITY EXAMINATIONS
2008/2009 ACADEMIC YEAR
SECOND YEAR SECOND SEMESTER EXAMINATIONS
FOR THE DEGREE OF
BACHELOR OF SCIENCE (COMPUTER SCIENCE)
COURSE CODE: COM 206
COURSE TITLE: PROGRAMMING II
DATE: 27th April 2009 TIME: 2.00 p.m. – 5.00 p.m.
INSTRUCTIONS TO CANDIDATES
· Answer questions one in section A and any two questions in
section B
· All questions in section two carry equal marks
This Paper Consists of 4 Printed Pages. Please Turn Over.
COM 206
COM 206:: PROGRAMMING II 2
SECTION A
Question One
a) Distinguish between source program and object code (4mks)
b) Explain three advantage and four disadvantages of low-level language (7mks)
c) Explain what the program below does in terms of data input and output (12mks)
Program sample;
CONST factor =12345;
Flag= ‘entry point’;
VAR i1, i2: Integer
r1, r2, r3: real;
c1, c2: char;
b1: boolean;
BEGIN
Readln (c1, c2, i1, r1, r2, r3);
…
Writln (‘ il=’, i1: 4, ‘12=’, i2: 4);
Writeln;
Writeln (‘r1= ‘, r1: 10: 2, ‘r2=’, r2:10:2, ‘r3=’, r3:12:4),
Wrteln ;
Write (‘first char is’, cl, second char is’, c2);
Write (‘Test status: ‘, b1: 5);
END.
d) Write set of constant definitions that will associate each of the following identifiers
with its corresponding constant value. (7mks)
COM 206
COM 206:: PROGRAMMING II 3
Identifier constant value
month July
fica 123-45-6789
price Ksh 95.00
gross 25000.00
partno 48837
bound 0. 00391
SECTION B
Question two
i) Explain the meaning of the following terms as used in computer programming. (8mks)
a) Translator
b) Assembler
c) Compilier
d) Object Code
ii) Discuss the major five generations of programming languages (10mks)
iii) Why is an executable file unique as compared to any other file? (2mks)
Question three
a) Give one advantage of compiling a program rather than interpreting it. (2mks)
b) Explain two advantages of modular programming (4mks)
c) Discuss six stages of program development in their respective order (12mks)
Question four
a) Explain why it is important to test a program before implementing it. (2mks)
b) Mmust Saving Society pays 50% interest on shares exceeding 100,000 shillings and
30% on shares that do not meet this target. However, no interest is paid on deposits in the
members’ Mmust bank account. Design a algorithm for a program that would:
i. Input a Particular member
ii. Calculate the interest and the total savings
COM 206
COM 206:: PROGRAMMING II 4
iii. Display the interest and the total savings on the screen for as particular
member of society (12mks)
c) Explain the three target groups for any type of documentation (6mks)
Question five
a) The class teacher of class one in a primary school requested a programmer to design
a simple program that would help her do the following:
i) Enter the name of students and marks obtained in eight subjects namely;
mathematics, English, Kiswahili, Science, Art, Social studies, History and
Music.
ii) After entering each subject mark, the program should calculate the total and
average marks for each student
iii) Depending on the average mark obtained, the program should assign grades as
follows:
- between 80 and 100 -A
- between 70 and 79 - B
- between 60 and 69 - C
- between 50 and 59 - D
- below 50 - E
The program should then display each student’s name, total marks, and the average
grade. Using a pseudo code, write an algorithm that shows the design of the program
(14mks)
b) Explain four advantages and two disadvantages of high level language (6mks)
More Question Papers