This is a simple Java project that simulates an electricity billing system for residential customers. The project includes classes for representing customer details, billing information, charges calculation, subsidy details, and total bill calculation.
The project follows the following file structure:
ElectricityBillingSystem
│
├── src
│ └── main
│ └── java
│ ├── Customer.java
│ ├── Bill.java
│ ├── BillingDetails.java
│ ├── SubsidyDetails.java
│ ├── TotalBill.java
│ └── ElectricityBillingSystem.java
│
└── README.md
- Customer Class: Encapsulates customer details like RR Number, Account ID, Name and Address, Tariff, etc.
- Bill Class: Encapsulates billing details including the bill period, reading date, bill number, and consumption details.
- BillingDetails Class: Encapsulates billing charges calculation, including fixed charges, energy charges, FPPCA charges, and tax.
- SubsidyDetails Class: Encapsulates subsidy details, in this case, Gruha Jyothi Subsidy.
- TotalBill Class: Encapsulates the calculation of the total bill amount.
- BillingDetails and SubsidyDetails: Both classes can inherit common properties or methods from a common superclass if needed.
- BillingDetails Class: Uses polymorphism in the
calculateTaxmethod to handle different types of charges.
- Bill Class: Represents essential details without exposing the internal implementation.
- ElectricityBillingSystem Class: Composes instances of Customer, Bill, BillingDetails, SubsidyDetails, and TotalBill classes to simulate the billing system.
-
Clone the repository:
git clone Akshaykumar2004/java-electricity-bill-system
-
Open the project in your preferred Java IDE.
-
Run the
ElectricityBillingSystemclass.
Represents customer details such as RR Number, Account ID, Name and Address, Tariff, etc.
Represents billing details including the bill period, reading date, bill number, and consumption details.
Handles billing charges calculation, including fixed charges, energy charges, FPPCA charges, and tax.
Represents subsidy details, in this case, Gruha Jyothi Subsidy.
Calculates the total bill amount by subtracting Sub-Total-2 from Sub-Total-1.
Main class to run the project. It instantiates objects of other classes, sets values, and displays the details.
This project is licensed under the MIT License - see the LICENSE file for details.