CIT-3102-FUNDAMENTALS-OF-COMPUTER-PROGRAMMING.doc
CIT-3102-FUNDAMENTALS-OF-COMPUTER-PROGRAMMING.doc
e) Write a C program to input two numbers then add the two numbers and display.
(4 marks)
g) Explain the importance of comments and describe the two types of comments used in
C programming. (3 marks)
(ii) Assembly
i) Write a C program to enter 6 numbers into an array then display the biggest and the
smallest number. (5 marks)
(i) Variables
(ii) Constants
b) (i) A retail shop wish acquire a program to enter product name, price and quantity
then calculate total price. Write a C program to solve the problem. (6 marks)
12345
1234
123
12
d) Write a program to input a word then display the number of characters entered.
(5 marks)
a) Compare switch and if statements explaining where each can be applied appropriately.
(4 marks)
b) Write a C program that reads the radius of a sphere and calculate the volume. Where
volume = 4 3 Πr3 (4 marks)
c) Design a C program to enter input employee name, hours worked and rate per hour
via the keyboard then calculate the basic pay=hours worked*rate per hour. (6 marks)
b) Write a program to enter 8 numbers then sort the numbers using linear sort technique.
(6 marks)
c) Write a program to create a data structure to store student name, mathematics, English
and Kiswahili marks then calculate total marks and average marks. (6 marks)
d) Write a program a Pascal program that converts temperature from degrees Celcius to
Farenheight. Where Farenheight=31+9/5*Celcius. The program should be presented
on the screen in the following format: 15 degrees Celcius is equal to 93.2 degree
Celcius. (4 marks)
a) Before the introduction of relational database, information system data were stored in
text files for future retrieval and data organization. Currently information systems
make use of database management system to organize and store data. Explain any 2
challenges that led to shifting from storage of data in text files to relational database
management system. (4 marks)
b) Differentiate between one dimension array and two dimension array. (4 marks)