JPR Java Programming
By Roll No.: 2222 TO
2224 From SYCO(B)
1
MICRO PROJECT REPORT
Name of institute: Y. B. Patil Polytechnic, Akrudi, Pune
.Name of Program: Diploma in Computer Engineering
Name of Course: Java Programming (JPR)
Course Code: 22412 Academic Year: 2023 – 24
Name of the students:
Sr. No. Roll no. Name of Students Enrollment No.
1 2222 Aayush Potdar 2201340159
2 2223 Vedant Thakur 2201340160
3 2224 Aditi Chavan 2201340161
Class: SYCO(B) Semester: 4 Scheme: I
Title of Project : Electricity Billing System
Name of teacher: Mrs. Dimpal Chavan
2
CERTIFICATE
This is to certify that the Project Report Entitled
Prepare a report on Electricity Billing System
Under the course: Java Programming
(JPR)Course Code:22412
Sr. No. Roll no. Name of Students Enrollment No.
1 2222 Aayush Potdar 2201340159
2 2223 Vedant Thakur 2201340160
3 2224 Aditi Chavan 2201340161
Is a Bonafide Work Carried Out By
In Partial Fulfillment of The Requirement For the Diploma in
Computer Engineering
During the Academic Year 2023-2024
Mrs. Dimpal Chavan Mrs. Pooja Ahuja Dr. [Link]
(Project Guide) (H.O.D) (Principal)
3
ACKNOWLEDGEMENT
Firstly, we would like to express our special thanks of gratitude to our
subject teacher Mrs. Dimpal Chavan and principal Dr. A. S. Kondekar
of Y. B. Patil Polytechnic, Akurdi, Pune, who gave us the golden
opportunity to do this wonderful project of Java Programming (JPR) on:
‘Electricity Billing System', due to which we came to know about so many
new things in the field of computer science and we are really thankful to
them for the same.
We also thank them for their able guidance and support in completing
our project.
Following on, we would also like to extent our gratitude to the Y.B.
PatilPolytechnic, Akurdi, Pune for providing us the facility
required.
In Addition to this, we would like to thank our friends who helpedus
a lot in finalizing this project within the limited time frame.
Lastly, thanks to our group members for co-operating and doing the
team work together.
4
INDEX
Sr. No. Topic name Page No.
1 ABSTRACT 6
2 INTRODUCTION 7
3 ALGORITHM 8
4 FLOWCHART 9
5 SOURCE CODE 10
6 OUTPUT 12
7 APPLICATION 13
8 CONCLUSION 15
5
➢ ABSTRACT:
The Electricity Billing System using Java is a software application designed to
automate the billing process for electricity consumption. This system allows
users to input customer details such as name, address, and units consumed, and
calculates the total bill amount based on the unit rate. It provides an efficient and
accurate method for generating electricity bills, reducing manual errors and
saving time. The system also includes features such as bill display and customer
information management. By leveraging Java programming language and
object-oriented principles, this system offers scalability, maintainability, and
flexibility. It serves as an effective tool for utility companies to streamline their
billing operations and enhance customer satisfaction.
6
➢ Introduction:
The Electricity Billing System is designed to streamline the process of
calculating and managing electricity bills for residential, commercial, and
industrial consumers. This system automates the traditionally manual task of
generating bills by integrating modern technologies and software solutions. By
leveraging computer algorithms and data processing capabilities, the Electricity
Billing System accurately calculates the amount owed by consumers based on
their energy consumption. It provides a user-friendly interface for consumers to
view their bills, make payments, and access billing history. Additionally, it
offers utilities companies efficient tools for managing customer accounts,
tracking energy usage patterns, and generating comprehensive reports.
Ultimately, the Electricity Billing System enhances efficiency, transparency, and
accuracy in the billing process while ensuring a seamless experience for both
consumers and utilities providers.
7
➢ ALGORITHM:-
1. Import the Scanner class from the [Link] package.
2. Create a class named ElectricityBill with private instance variables:
customerName, unitsConsumed, and unitRate.
3. Define a constructor for the ElectricityBill class that takes three parameters
(name, units, and rate) and initializes the instance variables.
4. Implement a method named calculateBillAmount() within the ElectricityBill
class to calculate the total bill amount by multiplying unitsConsumed by
unitRate.
5. Implement a method named displayBill() within the ElectricityBill class to
display the customer's name, units consumed, unit rate, and total bill amount.
6. Create a public class named Main.
7. Implement the main method within the Main class:
a. Create a Scanner object named scanner to read input from the user.
b. Display a welcome message for the Electricity Billing System.
c. Prompt the user to enter the customer's name, units consumed, and unit rate.
d. Read the input values for name, units, and rate using the Scanner object.
e. Create an ElectricityBill object named bill with the provided input values.
f. Call the displayBill() method on the bill object to display the electricity bill
details.
g. Close the Scanner object to release system resources.
8
➢ FLOWCHART:-
9
Source Code:
import [Link];
import [Link];
import [Link];
class ElectricityBill {
String customerName;
int unitsConsumed;
double unitRate, amount;
public ElectricityBill(String name, int units, double rate) {
customerName = name;
unitsConsumed = units;
unitRate = rate;
}
public void calculateBillAmount() {
amount = unitsConsumed * unitRate;
}
public void displayBill(String filename) {
try {
FileWriter writer = new FileWriter(filename);
[Link]("Customer Name: " + customerName + "\n");
[Link]("Units Consumed: " + unitsConsumed + "\n");
[Link]("Unit Rate: Rs. " + unitRate + "\n");
[Link]("Total Bill Amount: Rs. " + amount + "\n");
[Link]();
[Link]("Bill data written to file: " + filename);
} catch (IOException e) {
[Link]("An error occurred while writing to the file.");
[Link]();
}
}
}
public class Main {
10
public static void main(String[] args) {
Scanner scanner = new Scanner([Link]);
[Link]("Welcome to the Electricity Billing System");
[Link]("Enter customer name: ");
String name = [Link]();
[Link]("Enter units consumed: ");
int units = [Link]();
[Link]("Enter unit rate: ");
double rate = [Link]();
ElectricityBill bill = new ElectricityBill(name, units, rate);
[Link]();
[Link]("Enter the filename to save the bill data: ");
String filename = [Link]();
[Link](filename);
}
}
11
OUTPUT:-
12
➢ APPLICATION OF THE MICRO PROJECT:-
The provided Java code for an Electricity Billing System can be applied
in various contexts where there is a need to calculate electricity bills
based on consumption. Here are some potential applications:
1. Small-scale Utility Companies: Small utility companies serving
specific regions or communities can use this code to automate
their billing processes. It allows them to accurately calculate bills
for customers based on their electricity usage.
2. Residential Complexes: Apartment buildings, gated communities,
or housing societies can implement this system to manage
electricity billing for individual units. It provides a transparent and
efficient way to track consumption and generate bills for residents.
3. Commercial Establishments: Small businesses or shops that
consume electricity can utilize this system to keep track of their
energy usage and generate bills for payment. It helps them manage
their expenses related to electricity consumption.
4. Educational Institutions: Schools, colleges, or universities can
apply this code to manage electricity billing for their campuses. It
enables them to monitor energy usage in different buildings or
departments and allocate costs accordingly.
5. Co-working Spaces: Co-working spaces or shared office spaces
can use this system to calculate electricity bills for their tenants or
members. It helps in accurately dividing utility costs among
multiple users based on their usage.
6. Temporary Events or Festivals: Organizers of temporary events or
festivals that require electricity supply can employ this system to
calculate bills for vendors or participants. It ensures fair billing
13
based on the actual energy consumed during the event.
7. Home Automation Systems: Home automation systems that
monitor and control energy usage in smart homes can integrate
this code to include electricity billing functionality. It allows
homeowners to track their energy consumption and manage their
utility expenses.
8. Prototype or Educational Projects: Students or developers learning
Java programming can use this code as a basis for creating
prototype projects or educational exercises related to electricity
billing systems.
Overall, the provided Java code for an Electricity Billing System offers
a versatile solution that can be adapted and applied in various real-
world scenarios where there is a need to calculate and manage
electricity bills efficiently.
14
➢ CONCLUSION:-
In conclusion, the Java code for the Electricity Billing System provides a
foundational framework for automating and managing electricity billing
processes in various contexts. By accurately calculating bills based on
consumption and providing transparent billing information, this system
offers efficiency, convenience, and reliability for both service providers
and consumers.
Through its modular structure and user-friendly interface, the system can
be easily adapted to different applications, including utility companies,
residential complexes, commercial establishments, educational institutions,
and temporary events. It streamlines billing operations, enhances
transparency, and facilitates cost management, contributing to improved
customer satisfaction and operational efficiency.
Furthermore, the versatility of the system makes it suitable for educational
purposes, allowing students and developers to learn about programming
concepts, data management, and system design through practical
implementation.
Overall, the Electricity Billing System in Java serves as a valuable tool for
addressing the complexities of electricity billing while paving the way for
enhanced efficiency, accuracy, and convenience in managing energy
consumption and billing processes.
15
THANK YOU
16