Search This Blog

Loading...
If you have any problem or question please write in the comments. We will try to solve and send you the solution. Not just that we will also post your problems solution on our blog.

Wednesday, 20 April 2011

Java program to calculate electricity bill

import java.util.*;
class bill
{
public static void main (String arg[])
{
Scanner in = new Scanner (System.in);
int a,b=0,c=1;
while (c<=6)
{
System.out.print ("\n\t Enter bill of month no "+c+" = ");
a=in.nextInt();
b+=a;
++c;
}
int avg=b/6;
System.out.println ("\n\t Average bill = "+avg);
if (avg>5000)
System.out.println ("\n\t Government will pay ");
else
System.out.println ("\n\t Paid ");
}
}

14 comments:

  1. windowed application thatwill input your weight in pounds and convert into kilograms. display(y/n) use function

    ReplyDelete
  2. i want to find "show even and odd" programe.
    plzz can u help me ..!!
    with the help of loop.

    ReplyDelete
    Replies
    1. CAN YOU PLEASE ANSWER MY QUESTION ASAP!

      Delete
  3. Here is the link for finding even and odd numbers
    Click here

    If you have any problem, please let us know.

    Regards
    The JAVA PROGRAMS team

    ReplyDelete
  4. Suppose that electricity costs 4.75 cents per kilowatt hour, and that a surcharge
    of 10% is added to the bill. A city utility tax is 3% is also levied;however no tax
    is charged on the surcharge, and no surcharge is added for the tax. A penalty for a
    late payment is 4% of the total bill. Write a program that computes an electric bill.

    ReplyDelete
  5. i have a problem i write a program of electric bill on resdential rate,commercial rate,industiralrate if i want to enter another bill the reptition not doing well

    ReplyDelete
    Replies
    1. Send your problem and source code at publishjava@gmail.com
      We will send you solution in few hours.

      Delete
  6. i need to calculate an electricity bill with different slots using java guide me........thanks n advance

    ReplyDelete
  7. i need to calculate an electricity bill (electricy bill based upon the units consumed)with different slots using javaarrays guide me........thanks n advance

    ReplyDelete
    Replies
    1. OK send me
      cost per unit
      charges after due date
      and what do you mean by slots?

      Delete
  8. thanks for ur reply,,
    i need to get the cost per unit charges and i should not use it or give it in the if loop thats my problem
    and i mean the slots in the sense -the ranges between the readings...for ex........if i have 300 as readings i need to split it into different slots as first 50 for some cost and next 100 and it goes on till i complete the reading.

    ReplyDelete
  9. sir i m java learner how can i find hesco bill while my requierments are

    (((Write a program to show ur Hesco bill you only enter the units 1 to 100 units bill Rs:5/unit, 101 to 200 units bill Rs:10/unit 201 to 300 units bill is Rs:15/unit?))))

    ReplyDelete