please answer my question.
and plz don't spam.
Answers
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.
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.