Page 1 of 1

instruction Provide the flowchart, complete code and sample output for all of the questions. (1st Semester 2017/2018) Th

Posted: Sun Jul 03, 2022 11:21 am
by answerhappygod
instruction
Provide the flowchart, completecode and sample output for all of the questions.
(1st Semester 2017/2018) The DarulAman Water Utility(DWU) authority requires you to write a program that can calculatewater usage charges and display water bills to its customers. Thereare three types of customers: Home, Commercial and Industrial. Thewater charge rates vary depending on the customer usage type asdescribed below (code‘H’ means Home usage, code ‘C’ meansCommercial usage and code ‘I’ means Industrial usage):
Code Price
H RM40.00 plus RM0.015 per litre
C RM1000.00 for the first 40,000 litres used plus RM0.25 foreach additional litre used
I RM2000.00 if usage is between 40,000 and 100,000 litres(inclusive) RM3000.00 if usage is more than 100,000 litres
The program requires three inputs which are customer Accountnumber, usage type code and customer water usage (in litres). Theprogram will reread the usage type code if a wrong codeis entered. The output will display the water bill which containsthe account number, the usage type, the water usage and thecalculated water charge amount. The calculated charge must bedisplayed to TWO (2) decimal digits. The example of theprogram running (with three samples of inputs and outputs) areshown below (underlined texts are inputs to the program):
Complete the implementation of the program main methodas shown below: