- Write A Modular Program That Calculates And Prints The Bill For Riyadh S Power Consumption The Rates Vary Depending On 1 (53.16 KiB) Viewed 28 times
Write a modular program that calculates and prints the bill for Riyadh's power consumption. The rates vary depending on
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a modular program that calculates and prints the bill for Riyadh's power consumption. The rates vary depending on
Write a modular program that calculates and prints the bill for Riyadh's power consumption. The rates vary depending on whether the user is residential, commercial, or industrial. A code of R corresponds to a Residential, C corresponds to a Commercial, and I to Industrial. Any other code should be treated as an error. The program should read the power consumption rate in KWH (Kilowatt per Hour); then it calculates the due amount according to the following: The rate is SAR 5 per KWH for Residential, SAR 10 per KWH for Commercial and SAR 20 per KWH for Industrial. The input data should be made in the main method. The calculation of the due amount is made in a method called DueAmount. The total of the amounts due should also be calculated.