import [Link].
*;
class CalculateElectricityBill
{
double billpay;
CalculateElectricityBill(long units)
{
int conn=0;
//domestic
if(conn==1)
{
if(units<100)
billpay=units*1.0;
else if((units<=200)&&(units>=101))
billpay=units*2.50;
else if((units>=201)&&(units<500))
billpay= units*4;
else billpay=units*6;
}
//commercial
else
{
if(units<100)
billpay=units*2.0;
else if((units<=200)&&(units>=101))
billpay=units*4.50;
else if((units>=201)&&(units<500))
billpay= units*6;
else billpay=units*7;
}
}
}
public class Main
{
public static void main(String args[])
{
String name;
long units;
int newreading,oldreading,ebno;
Scanner sc=new Scanner([Link]);
[Link]("enter the customer name");
name = [Link](); [Link]("enter the Eb no");
ebno=[Link]();
[Link]("enter the new reading");
newreading= [Link](); [Link]("enter the old reading");
oldreading= [Link]();
units = newreading-oldreading;
CalculateElectricityBill b=new CalculateElectricityBill(units);
[Link]("Name::"+name);
[Link]("Eb No::"+ebno);
[Link]("Bill to pay : " + [Link]);
}
}