Computer Science, asked by vickramkishore66, 3 months ago

write a program in java for electricity bill calculation using package

Answers

Answered by itzcutejatni
1

Answer:

\huge\tt\colorbox{Orange}{\color{white}{Happy}}

\huge\tt\colorbox{white}{\color{blue}{Republic}}

\huge\tt\colorbox{green}{\color{white}{Day}}

Explanation:

  1. import java. util. *; ...
  2. public static void main(String args[]) { int United=280;
  3. double billpay=0; if(units<100)
  4. { billpay=units*1.20; }
  5. else if(units<300) { billpay=100*1.20+(units-100)*2;
  6. } else if(units>300) {
  7. billpay=100*1.20+200*2+(units-300)*3; }
  8. System. out. println("Bill to pay : " + billpay);
Answered by darksoul26
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