Can anyone help me out? The language is Java by the way. Thanks in advance!

Electricity Bill Calculator

An electricity company offers 3 different plans for its customers:

Plan A: For $75 per month, a usage of 500 killowatts (kW) is included. For each additional killowatt the customer pays $1 extra.

Plan B:For $100 per month, a usage of 700 killowatts (kW) is included. For each additional killowatt the customer pays $0.50 extra.

Plan C:For $125 per month, a usage of 900 killowatts (kW) is included. For each additional killowatt the customer pays $0.30 extra.

Write a program that calculates a customer's monthly bill. The program should ask the user:

a) to enter the letter of the plan (A, B, or C) that the customer has enrolled in

b) the number of killowatts that were used by the customer this month

The program should then display the total monthly bill for the customer.

Requirements

Use comments when appropriate.
Give your variables meaningful and descriptive names. Naming a variable as "x", or "y" is a bad example of variable naming.
Use prompts to ask the user what they have to do. Be clear. Your program should be user-friendly. (Hint: Ask a family member or friend to run your program and then ask them if your prompts make sense and/or are clear).
Use if/else or switch statements.
Display the total charges using the appropriate formatting to show 2 decimal places. Include the dollar sign using the appropriate formatting.
Input validation: If the user inputs a different letter other than A, B, or C, display an error message and terminate the program (do NOT use a loop as this topic is covered in Chapter 4).
If you are using jGrasp, save your java file as ElectricityBill.java and submit your Java file. If you are using the online Java compiler copy and paste your code in a word document and submit your word file.

Sure! I can help you with that. Here's how you can write a Java program to calculate a customer's monthly electricity bill:

1. Start by creating a new Java file called "ElectricityBill.java" and open it in your preferred Java IDE or text editor.

2. Declare the main class and main method:

```java
public class ElectricityBill {
public static void main(String[] args) {
// Your code goes here
}
}
```

3. Inside the main method, declare variables to store the plan letter and the number of kilowatts used:

```java
char plan;
int kilowatts;
```

4. Use the `Scanner` class to read input from the user:

```java
import java.util.Scanner;

Scanner scanner = new Scanner(System.in);

System.out.print("Enter the plan letter (A, B, or C): ");
plan = scanner.nextLine().charAt(0);

System.out.print("Enter the number of kilowatts used this month: ");
kilowatts = scanner.nextInt();
```

5. Next, use conditional statements to calculate the total monthly bill based on the plan:

```java
double baseCharge;
double extraCharge;

if (plan == 'A') {
baseCharge = 75.0;
extraCharge = 1.0;
} else if (plan == 'B') {
baseCharge = 100.0;
extraCharge = 0.5;
} else if (plan == 'C') {
baseCharge = 125.0;
extraCharge = 0.3;
} else {
System.out.println("Invalid plan letter. Please enter A, B, or C.");
return;
}

double totalBill = baseCharge + (kilowatts > 500 ? (kilowatts - 500) * extraCharge : 0);
```

6. Finally, display the total monthly bill to the user:

```java
System.out.printf("Your total monthly bill is $%.2f", totalBill);
```

7. Close the `Scanner` at the end of the program:

```java
scanner.close();
```

That's it! You have now created a Java program to calculate a customer's monthly electricity bill based on the selected plan and the number of kilowatts used. Remember to save the file and run the program to test it.

If you have any further questions, feel free to ask!