Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 2

import java.util.

*;

public class year

public static void main(String args[])

Scanner sc=new Scanner(System.in);

int name=sc.nextInt;

int customerid =sc.nextInt;

int consumtionmonth=sc.nextInt;

int unitsconsumed=sc.nextInt;

int totalcharges;

if(unitsconsumed<=100){

charges=1.75*unitsconsumed;

if(unitsconsumed<=300)

charges=2.50*unitsconsumed;

}else(unitsconsumed <=500)

charges=3.50*unitsconsumed;

else(unitsconsumed >=800)

charges=unitsconsumed*4;
}

System.out.println("the electricity bill of the consumer"+name);

System.out.print("****************************************************");

System.out.print("with consumer id "+customerid);

System.out.print("****************************************************");

System.out.println(consumtionmonth+"it is of this month");

System.out.print("****************************************************");

System.out.println("total units consumed are"+unitsconsumed+"with the charges"+charges);

System.out.print("****************************************************");

System.out.print("please pay this bill as soon as possible and thanku");

You might also like