Question 2
a)
The Ghana water company wants to automate its activity.
a. accept the following input:
i. Customer’s name
ii. Quantity of water consumed
b. distinguish the following categories of consumers based on the number of galons of
water used:
i. Domestic if water consumed is less than or equal to 500 galons a month
ii. Commercial if water consumed is more than 500 but less than or equel to1000 galons
a month
iii. Industrial if water consumed is more than 1000 galons of water a month.
c. Computer the following:
i. Domestic, amount to pay is GHC 0.25 per galon
ii Commercial, amount to pay is GHC 0.35 per galon
iii. Industrial, amount to pay is GHC 0.50 per galon
d. Display
i. Custmers name:
ii galons of water consumed:
ii Amout of water consumed GHC:
iii 2% of amount consumed to be added for rural water project and fire service.
iv. Total amount payable = Amount of water consumed + amount for rural water and fire
service
Draw the flowchart and write a C++ software for a solution to solve the problem above
AP(15)
b) In computer programming algorithms both Iteration and recursion repeatedly execute a
set of instructions. Using sample code snippets or algorithms, critically explain the
primary difference between Iteration and recursion algorithms
A