QUESTION 16
1. Below is an algorithm that is used to compute the values of R, S and T.
P=5
Q=6
INPUT N
If N is GREATER OR EQUAL TO 10
R = P *Q
S = Q -P
T=P+Q+R+S
ELSE
R=P+Q
S=Q
T=R+S
END IF
PRINT R, S and T
(a) From the algorithm, determine the output if the input value of N is:
(i) 7;
(ii) 10
(b) Draw a flowchart for the algorithm in (a) above.
2. Imara Kabisa Bank(IKB) pays 10% interest in shares exceeding 150,000 shillings and 4% on
shares that do not meet this target. However no interest is paid on deposits in the members
(IKB) bank account.
(a) Design a pseudo code for a program that would
(i) Prompt the user for shares and deposits of a particular member.
(ii) Calculate the interest and total savings
(iii) Display the interest and total savings
(iv) Display the interest and total savings in the screen for a particular member.
3. A car rental firm leases its cars for Ksh.2500.00 per day. The manager giver a discount based on
the number of days that the car is rented. If the rental period is greater than or equals to 7 days
then a 25% discount is given. Write a peudocode to accept a car number and the rental period,
and calculate the total amount earned by the company when a car is leased.
4. Cute Goods Supermarket pays 10% commission on sales that are above 20,000 kshs, and 4%
on any sales that are less than this target. However, no commission is paid on the capital of
the salesman.
(a) Design a pseudo code for a program that would:
(i) Prompt a user for sales and capital of a particular salesman
(ii) Calculate the commission and total amount
(iii) Display the commission and total amount on the screen for a particular
salesman
5. a) Cute Ideas Sacco (CIS) pays 10% interest on shares exceeding ksh100, 000 and 6% on
shares that do not meet this target. However no interest is paid on deposits in the members
CIS account.
a) Design a pseudocode program that would:
(i) Prompt the user for shares and deposits of a particular member
(ii) Calculate the interest on total savings
(iii) Display the interest and total savings on the screen for a particular member of the
society
b) Draw a flow chart for the above pseudocode