Computer Science, asked by sneha413639, 2 months ago

please answer my question.
and plz don't spam. ​

Attachments:

Answers

Answered by subramaniam1949
0

Good Morning / Afternoon

My favourite women freedom fighter is Sarojini Naidu.

• She was born on February 13 , 1879.

• She was born in a Bengali Hindu family.

Answered by udayagrawal49
3

Answer: The required java program is :-

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

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

    int units = scan.nextInt();

    scan.close();

    double totalCost , cost=0.0;

    if(units <= 100) {

        cost = units*6.00;

    }

    else if (units>=101 && units<=300) {

        cost = (100*6.00)+((units-100)*7.00);

    }

    else if (units>=301 && units<=600) {

        cost = (100*6.00)+(200*7.00)+((units-300)*8.00);

    }

    else if (units>600) {

        cost = (100*6.00)+(200*7.00)+(300*8.00)+((units-600)*9.00);

    }

    totalCost = 1000+cost;

    System.out.println("Total electricity bill to be paid : ₹ "+totalCost);

   }

}

You can also use try-catch blocks to avoid any errors.

Please mark it as Brainliest.

Similar questions