write a program in java for electricity bill calculation using package
Answers
Answered by
1
Answer:
Explanation:
- import java. util. *; ...
- public static void main(String args[]) { int United=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);
Answered by
6
Answer:
import java. util. *; class ComputeElectricityBill.
{ public static void main(String args[])
{ long units;
System. out. println("enter number of units");
if(units<100) billpay=units*1.20;
else if(units<300) billpay=100*1.20+(units-100)*2;
billpay=100*1.20+200 *2+(units-300)*3;
} }
Explanation:
#Hope you have satisfied with this answer..
Attachments:
Similar questions