0% found this document useful (0 votes)
65 views2 pages

Bcsl21 Practical

This program calculates an electricity bill based on meter readings and units consumed. It displays the meter number and previous reading, allows the user to enter the current reading to calculate units used. It then displays the tariff structure and calculates the charges, surcharge if over 300 units, and net amount payable according to the tariff applied to the consumption units. It outputs the bill details including charges, surcharge, net amount and due date.

Uploaded by

Work Work
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views2 pages

Bcsl21 Practical

This program calculates an electricity bill based on meter readings and units consumed. It displays the meter number and previous reading, allows the user to enter the current reading to calculate units used. It then displays the tariff structure and calculates the charges, surcharge if over 300 units, and net amount payable according to the tariff applied to the consumption units. It outputs the bill details including charges, surcharge, net amount and due date.

Uploaded by

Work Work
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Q1.

The Electricity Bill Calculator is an application-based micro project that calculates the month’s electricity bill based
on the appliances or loads and units consumed. People who do not have a technical understanding of calculating power
bills can use this program to forecast/calculate their electricity bills. The application should have the following features:
 To display the Meter Number
 To display the previous meter reading
 Facility to enter present meter-reading
 To display the no. of units consumed
 To display the complete Tariff Structure (Domestic, Non-Domestic, Industrial)
 Provision to input the no. of units consumed per month
 To display the bill-amount payable as per the tariff structure
 To display the due date of the payment
Note: Assumptions can be made wherever necessary and list them. You must execute the program and submit the
program logic, sample input and output along with the necessary documentation for this question.

Answer:
#include <stdio.h>
int main()
{ int meterno = 123, conu, curr, past_reading = 1230;
float chg, surchg = 0, gramt, netamt;
printf("Meter no : %d\n", meterno);
printf("Past meter reading : %d \n", past_reading);
printf("Input the current meter reading : ");
scanf("%d", &curr);
conu = curr - past_reading;
printf("Unit consumed : %d", conu);
printf("\n\n***************Tariff charges******************\nType Charges\n");
printf("Domestic(Less than 200) @1.2/unit\n");
printf("(upto 400 more than 200) @1.5/unit\n");
printf("(upto 600 more than 400) @1.8/unit\n");
printf("(More than 600) @2.0/unit\n");
printf("Non-domestic @2.0/unit\n");
printf("Indrustrial @2.5/unit\n");
if (conu <200 ) chg = 1.20;
else if (conu>=200 && conu<400) chg = 1.50;
else if (conu>=400 && conu<600) chg = 1.80;
else chg = 2.00; gramt = conu*chg;
if (gramt>300){ surchg = gramt * 15 / 100.0;
netamt = gramt + surchg;}
if (netamt < 100)
netamt =100;
printf("\n**************Electricity Bill*************\n");
printf("Enter Consumed unit per month: ");
scanf("%d", &conu);
printf("Amount Charges @Rs. %4.2f per unit :%8.2f\n",chg,gramt);
printf("Surchage Amount :%8.2f\n",surchg);
printf("Net Amount Paid By the Customer :%8.2f\n",netamt);
printf("Due date for payment : 18-11-2022");}

You might also like