Computer Science, asked by ekta182718, 11 months ago

A flowchart for a computer java program based on an electricity bill

Answers

Answered by deepakjack914
0

Explanation:

Java Program to Calculate Electricity Bill using Else If This Java program asks the user to enter the units consumed. Next, it calculates the Total Electricity bill. This approach is useful if the Electricity board is charging different tariffs for different units. For this example, we are using Else If Statement.

Answered by ap4435341
0

Explanation:

s we know that 1 Unit = 1kWh

So total kWh = 500 watts x 24 hours x 30 days

= 360000

So, we want to convert into units:

Where 1 unit = 1kWh

Total consumed units are as 360000/1000 = 360

And, cost per unit is = 7, the total cost of the electricity bill is 360 x 7 = 2520( In $, £, €, INR, Rs, DHR

here.

import java.util.*;

class ComputeElectricityBill

{

public static void main(String args[])

{

int units=280;

double billpay=0;

if(units<100)

{

billpay=units*1.20;

}

else if(units<300)

{

billpay=100*1.20+(units-100)*2;

}

else if(units>300)

{

billpay=100*1.20+200*2+(units-300)*3;

}

System.out.println("Bill to pay : " + billpay);

}

}

here is ur answer

Similar questions