Structured Program Exams
Structured Program Exams
Structured Program Exams
R1
R2
2
Write a c program that accepts values R1 and R2 from the keyboard and then the
Computes the area of the cross section of the pipe. The program should then
display value of R1, R2 and the area of the cross section.
Hint: Cross section area = pi(R2)2-pi(R1)2 (6mks)
5. (a)An organisation maintains an employee file in which each record has the following
data: employee number, name and salary.
The salary of the employees is to be increased and the record details printed for
issuance to the employees. For employees earning ksh.5000 or less, the salary is to be
increased by 15%, for employees earning more than ksh.5000 but less than 12000, the
salary is to be increased by 10%, for employees earning ksh.12000 and more, the
salary is to be increased by 5%
i. Draw a flowchart to represent the above information (7mks)
(b)Explain any four Basic data types used in C-programming (4mks)
(c)Write a c-program to calculate surface area of a cylinder (7mks)
(d)State any four operators used in C-programming (2mks)