import java.util.Date;
import java.util.Scanner;
public class ElectricityBill
{
/*
* 4.75 cents per KiloWatt per hour
* Surcharge 10%
* City utility tex 3%
* 4% of total bill charged on late payment
*/
public static void main(String[] args)
{
int totalUnits;
double billCharged;
Scanner in = new Scanner(System.in);
Scanner ins = new Scanner(System.in);
Date date = new Date();
System.out.print("Enter total units consumed (in KiloWatt) = ");
totalUnits = in.nextInt();
billCharged = totalUnits*4.75;
System.out.println("Day of month = "+date.getDate());
if (date.getDate()> 10)
{
billCharged += billCharged * (0.10+0.04);
}
billCharged += billCharged *(0.03);
System.out.println("Your total bill = "+billCharged);
}
}
Note that 10th of each month is assumed to be the due date of bill payment. If any customer pays bill after due date, 10% surcharge and 4% of total bill on late payment will be charged.