Create a kotlin program to calculate total electricity bill based on units consumed given some conditions
Answers
Answer:
Here U Go
Explanation:
(ADD THE STARTING AND ENDING)
/* C program for electric bill that help to
* disply the consumption of electricity
* in a house or in a factory. it is help to
* automate the system and save the
* time through electricity bill program * /
# include <stdio.h>
# include < conion.h>
main()
{
float per,pr,d,nm,g;
Char nm[10],ad [20];
Int cm;
Printf("enter Name = "):
scanf("%S",&nm);
printf ("enter address= ");
scanf("%S",&ad);
Printf(" enter consumer ID =);
scanf("%d",&cn);
printf("enter old reading =");
scanf("%f",&pr1);
printf("enter present reading =");
scanf("%f",&pr2);
d=pr-pr1;
If(d<=100)
{
nr=1.5*d+100;
}
If(d>100&&d<=200)
{
g=1.5*100;
d=d-100;
nr=g+(2*d)+100;
d=d+100;
}
If(d>200&&d<=300)
{
g=2*200;
d=d-200;
nr=g+(2.5*d)+100;
d=d+200;
}
If(d>300&&d<=400)
{
nr=(3*d)+100;
}
If(d>400)
{
nr=(4*d)+100;
}
printf ("\n ELECTRICITY BILL PAY SLIP");
printf ("\n =================");
printf ("\n Name. =%s",nm);
printf ("\n Address. =%s",ad);
printf ("\n consumer no=%d",cn);
printf ("\n net unit =%f",d);
printf ("\n total cost. =%f",nr);
printf ("\n =================");
getch();
}
HOPE IT HELPS