Computer Science, asked by ayush3027, 6 months ago

South Bihar Power Distribution Company Ltd. Electricity Board charges the bill according to the number

of units consumed and the rate as given below:

Units Consumed Rate per Unit

First 100 units Rs.5.00 per unit

Next 200 units Rs. 6.00 per unit

Above 300 units Rs.7.00 per unit

Write a program in java to accept the total units consumed by a customer and calculate the bill. Assume that a meter

rent Rs. 150 is charged from the customer.​

Answers

Answered by anindyaadhikari13
6

Answer:-

This is the required program.

import java.util.*;

class Bill

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.print("Enter the total number of units: ");

double b=0;

int units=sc.nextInt();

if (units<=100)

b=units*5.0;

else if(units<=300)

b=units*6.0;

else

b=units*7.0;

b+=150;

System.out.println("Bill: "+b);

}

}

Answered by runakhatun39452
0

Answer:

a le mera FF uid 1745695183

Similar questions