IN JAVA
The West Bengal Electricity Board(WBEB) charges from the consumers according to the
units consumed per month but the amount is to be paid quarterly in advance as per the given tariff:
UNITS CONSUMED CHARGES
Up to 100 units Rs. 4.80/unit
For next 200 units Rs. 5.50/unit
For next 300 units Rs. 6.80/unit
More than 600 units Rs. 7.50/unit
Write a program to input consumer’s name, consumer number and the units consumed. The program
displays the following information at the time of receiving the money receipt as:
West Bengal Electricity Board
Money Receipt
Consumer Number:
Consumer’s Name:
Units Consumed:
Monthly Amount:
Amount to be paid Quarterly:
Answers
Answered by
2
Answer:
import java. util. *; ...
public static void main(String args[]) { long units;
units=Long. parseLong(args[0]); 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);
Similar questions