Q3. A power distribution company charges its consumers depending on the type of customer: 1- Class A or 2- Class B, the amount to be charged for Class A is based on the following: Consumption (in kwh) Charge per kwh 5 – 10.99 1 OMR 11-15.99 2 OMR 16 and above 3 OMR Class A customer is charged 7% more than Class B. Total bill is subject to 4% tax. Write a C program to input for the type of customer and the consumption. Output the total consumption, tax, and the total amount to be paid by the customer. Display all values using 3 decimal places. Add a do-while so that the program should run continuously until the user decides to stop.
please also screen shot the output with abilitey to copy the code from your answer
C program to calculate the total payable amount by a customer on the power consumption.
There are two types of customers.
One is Class A type and the other is Class B type.
The charges for the Class A type consumption are:
The charges for Class A type customer is 7% more than the Class B type customer.
A 4% tax is applied to the total bill.
Display the total consumption, tax, and the total amount payable by a customer.
prompt the user to enter the class type.
Store the class type in the variable named customerType.
prompt the user to enter the consumption
Store the consumption in the variable named consumption.
Calculate the charges.
If the user wants to calculate the charges for class B subtract 7% from the charges.
Calculate the tax on charges.
Calculate the total amount by adding the tax amount in the consumption charges.
display the total consumption.
display the tax amount.
Display the total amount.
Use the do-while loop to run the program continued until the user wants to stop.
Step by step
Solved in 3 steps with 3 images