Ecv 102 Computer Programming I Main Exam
Ecv 102 Computer Programming I Main Exam
KENYATTA UNIVERSITY
UNIVERSITY EXAMINATIONS 2021/2022
FIRST YEAR, SECOND SEMESTER EXAMINATION FOR THE DEGREE OF BACHELOR OF
SCIENCE (CIVIL ENGINEERING)
ECV 102: COMPUTER PROGRAMMING I
DADATE: APRIL 2022 TIME: 2HOURS
------------------------ --------------------------------------------------------
INSTRUCTIONS
• This paper consists of FIVE questions
• Question ONE is compulsory and contains 30 marks
• Attempt any TWO of the remaining four questions. Each question is 20 marks
--------------------------------------------------------------------------------------------------------------
Design an algorithm that uses this formula to find the area of a triangle [4 marks]
• Write a program in C++ to enter two angles of a triangle and find the third angle.
[6 marks]
• To make a profit, the cost of constructing an apartment is marked up by 40%. Write a program to find the
selling price of apartment sold by real estate developer. [4 marks]
• An ATM allows a customer to withdraw a maximum of kshs 40000 per day. If a customer withdraws more
than kshs 30000, the service charge is 4% of the amount over kshs 30000. If the customer does not have
sufficient money in the account, the ATM informs the customer about the insufficient fund and gives the
option to withdraw the money for a service charge of kshs 250.00. If there is no money in the account or if
the account balance is negative, the ATM does not allow the customer to withdraw any money. If the
amount to be withdrawn is greater than kshs 40000, the ATM informs the customer about the maximum
amount that can be withdrawn.
•Write an algorithm that allows the customer to enter the amount to be withdrawn. The algorithm then
checks the total amount in the account, dispenses the money to the customer, and debits the account by the
amount withdrawn and the service charges, if any. [6 marks]
•Write a C++ program to implement above program. [6 marks]
[12 Marks]
Where
π (3.14): Circular constant
DC (mm): Drill diameter
n (min-1): Spindle speed
write a program to display various VC for drill diameter between 10mm
to 35 mm in steps of 3
[8 marks]
[10 marks]
***************************END OFEXAMINATION**********************