UNIVERSITY EXAMINATIONS: 2017/2018
EXAMINATION FOR THE DEGREE IN BACHELOR OF SCIENCE IN
INFORMATION TECHNOLOGY/ BACHELOR OF BUSINESS
BIT1303A BBIT105 PROGRAMMING METHODOLOGY
MODE: FULL TIME/PART TIME/DISTANCE LEARNING
DAY: MARCH.2019 DURATION 2 HOURS
INSTRUCTION: Answer question ONE and any other THREE questions
QUESTION ONE [30 MARKS]
a) Define the following terms as used in programming methodology.
iii. Programming paradigms.
iv. Structured programming.
b) State TWO advantages of structured programming.
c) State and explain the stages of program development lifecycle(PDLC).
d) Name and explain THREE programming errors.
e) Write a pseudo code for a program that calculate the area and perimeter of a rectangle once
given length and width values.
f) With an aid of a C program explain how conditional operators work.
QUESTION TWO [20 MARKS]
a) State two reasons for the shift from machine language to assembly language.
b) Explain two advantages of modular approach in programming.
c) Distinguish between reserved words and identifiers as used in programming.
d) Write a C program that accepts the name of a student. The program then outputs the name and
the message “Welcome to C Programming” on the same line.
e) Briefly explain any four programming tools.
QUESTION THREE [20 MARKS]
a) Write a C program that will prompt a student to enter the score obtained in a particular
subject. If the score is 1 or 2 the program outputs Distinction. If the score is 3 or 4 the
program outputs Credit. If the score is 5 or 6 the program outputs Pass. If the score is 7 the
program outputs Referred otherwise the program outputs Fail. Use case control structure.
b) State any FOUR rules of creating variables in C programming.
c) Describe the use of the following string functions in C language.
i. strlen ()
ii. strcpy ()
iii. strcat ()
iv. strcmp ()
d) Explain FOUR different primary data types used in C language. In in your explanation,
indicate maximum memory size for each type, values stored and the range of values.
QUESTION FOUR [20 MARKS]
a) The table below shows the charges applicable to different amounts of water consumed by
clients in a particular town. The volume consumed is in cubic meters(M3).
In addition to the consumption, the amount of the water bill will consist of a standing charge of
Ksh 200 and a sewerage fee equivalent to 20% of the consumption. Write a C program that
prompts a user to enter the volume of water consumed. The program then computes and outputs
the amount of the water bill. Use if…else control structure.
b) Explain is the difference between the constants 6,’6’ and “6”.
c) List and explain any FOUR format specifier in C language.
d) Explain the main difference between structure and union.
QUESTION FIVE [20 MARKS]
a) Differentiate argument and parameters as used in C functions.
b) Write a C program to receive ten integers, store them in an array then sort the elements in an
ascending order then display the sorted elements onscreen.
c) Explain FOUR features of the C language.
d) In C language, a pointer is a pointer is a variable or type that refers to the address of a value.
Explain any THREE uses of pointers.