Electricity bill
Electricity bill
import java.util.ArrayList;
import java.util.Scanner;
class Customer {
this.customerId = customerId;
this.name = name;
this.unitsConsumed = unitsConsumed;
this.billAmount = calculateBill();
double rate;
rate = 1.50;
rate = 2.00;
} else {
rate = 3.00;
}
@Override
", Units Consumed: " + unitsConsumed + ", Bill Amount: ₹" + billAmount;
int choice;
do {
System.out.println("3. Exit");
choice = scanner.nextInt();
switch (choice) {
case 1 : addCustomer();break;
case 2 : displayBills();break;
case 3 : System.out.println("Exiting the system. Goodbye!");break;
customers.add(customer);
if (customers.isEmpty()) {
} else {
System.out.println("\nCustomer Bills:");
System.out.println(customer);
}
}