A PROGRAMMING TO PRINT THE ELECTRICITY BILL
if a=100 =200;
if a>100&&a<=300=200+1.00 per unit
if a>300&&a<=500=200+1.55 per unit
if a>500=200+2.10 per unit
public class electricity {
void main(int a)
{ double t=0;
if(a<=100)
{
t=200;
}
if(a>100&&a<=300)
{
t=((a-100)*1.00)+200;
}
if(a>300&&a<=500)
{
t=(a-300)*1.55+(200*1.00)+200;
}
if(a>500)
{
t=(a-500)*2.10+(200*1.55)+200+(1*200);
}
System.out.print(t);
}}
this is an example related to this type of programing
if a=100 =200;
if a>100&&a<=300=200+1.00 per unit
if a>300&&a<=500=200+1.55 per unit
if a>500=200+2.10 per unit
public class electricity {
void main(int a)
{ double t=0;
if(a<=100)
{
t=200;
}
if(a>100&&a<=300)
{
t=((a-100)*1.00)+200;
}
if(a>300&&a<=500)
{
t=(a-300)*1.55+(200*1.00)+200;
}
if(a>500)
{
t=(a-500)*2.10+(200*1.55)+200+(1*200);
}
System.out.print(t);
}}
this is an example related to this type of programing