A housing society having 400 members pay the electricity bill at the following rates: No. of Units consumed Charges/Unit (₹) For the First 200 units 2.65 For the next 300 units 3.90 Over 500 units 4.65 Surcharge @ 5% of

CS Professional · Information Technology and Systems Audit · PYQS · December 2021
A housing society having 400 members pay the electricity bill at the following rates: No. of Units consumed Charges/Unit (₹) For the First 200 units 2.65 For the next 300 units 3.90 Over 500 units 4.65 Surcharge @ 5% of the bill is to be added to the charges. Draw a flow chart for the above, which will read the house number and the number of units consumed and print out the total charges with the house number and the unit consumed.

Answer & Explanation:

Here's a description of the flowchart logic: Start Read House No. Initialize counter I = 0 Loop: I = I + 1 Decision: Is Units > 500? If Yes: Calculate Amount (Amt) = (Units - 500) * 4.65 + 300 * 3.90 + 200 * 2.65 If No: Go to next decision. Decision: Is Units > 200? If Yes: Calculate Amount (Amt) = (Units - 200) * 3.90 + 200 * 2.65 If No: Calculate Amount (Amt) = Units * 2.65 Calculate Total Charges (Chrg) = Amt + Amt * 0.05 (5% surcharge) Print House No, Units, Chrg Decision: Is I < 400? (To process all 400 members) If Yes: Go back to Loop (step 4) If No: Go to Stop. Stop

Topics: Programming Concepts

Open in Interactive Practice Hub · Full Practice Hub · Chapter Weightage · More in this subject

Related Questions in this Topic