Professional Documents
Culture Documents
Ajp Microproject
Ajp Microproject
MICRO PROJECT
Name:
Roll No:
Enrolment No:
Certificate
SEAL OF
INSTITUTE
Part A: Micro Project Proposal
(06) (04)
01
02
03
2. Literature Survey/Information
Collection
3. Project Proposal
7. Report Preparation
8. Presentation
9. Viva
7
Micro-Project Evaluation Sheet
Title: Different type of Operating System
5 Quality of Prototype/Model/Content
6 Report Preparation
7 Presentation .
8 Viva
9
Index
Sr. Page
Content
No. No.
1. Introduction 11
5. Conclusion 32
6. Reference 32
10
Introduction
To design the billing system more service oriented and simple, the following
features have been implemented in the project. The application has high speed
of performance with accuracy and efficiency.
The software provides facility of data sharing, it does not require any staff as in
the conventional system. Once it is installed on the system only the meter
readings are to be given by the admin where customer can view all details, it
has the provision of security
restriction.
The electricity billing software calculates the units consumed by the customer
and makes bills, it requires small storage for installation and functioning. There
is provision for debugging if any problem is encountered in the system.
Advantages
• The system excludes the need of maintaining paper electricity bill as all
the electricity bill records are managed electronically.
• Administrator doesn’t have to keep a manual track of the users. The
system automatically calculates fine
• The system excludes manual bill calculation.
• Users don’t have visit the office for bill payment.
• There is no need of delivery boy for delivering bills to users place.
• Thus, it saves human efforts and resources.
Disadvantages
• Users must have a reliable internet connection.
• There is no human interaction if users have some enquiry.
12
Complete Code for Electricity Bill Management
System Project in Java
1. import java.sql.*;
2. public class Conn {
3. Connection c;
4. Statement s;
5. Conn() {
6. try {
7. c = DriverManager.getConnection("jdbc:mysql:///ebs", "root", "root"); // replace the
password according to your account
8. s = c.createStatement();
9. } catch (Exception e) {
10. }
11. }
13
12. }
import javax.swing.*;
import java.awt.*;
public class MainScreen {
JFrame frame;
14
progressBar.setStringPainted(true);
progressBar.setBackground(Color.black);
progressBar.setForeground(new Color(0XFF6464));
progressBar.setValue(0);
frame.add(progressBar);
}
public void runningPBar(){
int i=0;
while( i<=100)
{
try{
Thread.sleep(40);
progressBar.setValue(i);
i++;
if(i==100)
frame.dispose();
}catch(Exception e){
e.printStackTrace();
}
}
}
15
3. Login Module
This class of Electricity Bill Management System will help to create a
login/register page so the user can enter the details and log in or go to the
signup page to register. Name it Login.java.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class Login extends JFrame implements ActionListener{
JButton login, cancel, signup;
JTextField username, password;
Choice logginin;
Login() {
super("Login Page");
getContentPane().setBackground(new Color(0X78DEC7));
setLayout(null);
16
cancel.setBackground(Color.orange);
cancel.addActionListener(this);
add(cancel);
setSize(840, 500);
setLocation(200, 100);
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == login) {
String susername = username.getText();
String spassword = password.getText();
String user = logginin.getSelectedItem();
try {
Conn c = new Conn();
String query = "select * from login where username = '"+susername+"' and password =
'"+spassword+"' and user = '"+user+"'";
ResultSet rs = c.s.executeQuery(query);
if (rs.next()) {
String meter = rs.getString("meter_no");
setVisible(false);
new Home(user, meter);
} else {
JOptionPane.showMessageDialog(null, "Invalid Login");
username.setText("");
password.setText("");
}
} catch (Exception e) {
}
} else if (ae.getSource() == cancel) {
setVisible(false);
} else if (ae.getSource() == signup) {
setVisible(false);
new Signup();
}
}
17
public static void main(String[] args) {
new Login();
}
}
4. Signup Module
On this page of Electricity Bill Management System, the user can enter the
details and create an account as a customer or an admin. Name it Signup.java.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class Signup extends JFrame implements ActionListener{
JButton create;
Choice accountType;
JTextField meter, username, name, password;
Signup(){
18
accountType = new Choice();
accountType.add("Admin");
accountType.add("Customer");
accountType.setBounds(260, 50, 150, 20);
panel.add(accountType);
meter.addFocusListener(new FocusListener() {
19
JLabel lblpassword = new JLabel("Password");
lblpassword.setBounds(100, 210, 140, 20);
lblpassword.setForeground(Color.black);
lblpassword.setFont(new Font("MV Boli", Font.BOLD, 14));
panel.add(lblpassword);
accountType.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ae) {
String user = accountType.getSelectedItem();
if (user.equals("Customer")) {
lblmeter.setVisible(true);
meter.setVisible(true);
name.setEditable(false);
} else {
lblmeter.setVisible(false);
meter.setVisible(false);
name.setEditable(true);
}
}
});
setVisible(true);
}
try {
Conn c = new Conn();
20
JOptionPane.showMessageDialog(null, "Successfull");
setVisible(false);
new Login();
} catch (Exception e) {
}
}
}
public static void main(String[] args) {
new Signup();
}
}
5. Home Module
After the user is logged in, he will be redirected to this screen where a bunch of
options is available according to the user type i.e admin or customer. Name
it Home.java.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Home extends JFrame implements ActionListener{
String atype, meter;
Home(String atype, String meter) {
this.atype = atype;
this.meter = meter;
setLayout(null);
setBounds(300, 100, 700, 600);
setResizable(false);
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icon/elec1.png"));
Image i2 = i1.getImage().getScaledInstance(700, 600, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
add(image);
21
mb.setBackground(new Color(0XFF5757));
setJMenuBar(mb);
if (atype.equals("Admin")) {
mb.add(master);
} else {
mb.add(info);
}
setLayout(new FlowLayout());
setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
String msg = ae.getActionCommand();
22
if (msg.equals("New Customer")) {
new NewCustomer();
} else if (msg.equals("Customer Details")) {
new CustomerDetails();
} else if (msg.equals("Calculate Bill")) {
new CalculateBill();
} else if (msg.equals("View Information")) {
new ViewInformation(meter);
}
}
public static void main(String[] args) {
new Home("", "");
}
}
23
p.setBackground(new Color(0X78DEC7));
add(p);
24
tfemail = new JTextField();
tfemail.setBounds(240, 280, 200, 20);
p.add(tfemail);
setLayout(new BorderLayout());
add(p, "Center");
getContentPane().setBackground(new Color(0X78DEC7));
setVisible(true);
}
try {
Conn c = new Conn();
c.s.executeUpdate(query1);
c.s.executeUpdate(query2);
JOptionPane.showMessageDialog(null, "Successful");
setVisible(false);
} catch (Exception e) {
25
}
}
}
CustomerDetails(){
super("Customer Details");
setSize(700, 500);
setLocation(200, 150);
26
table.setModel(DbUtils.resultSetToTableModel(rs));
} catch (Exception e) {
}
setVisible(true);
}
27
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class CalculateBill extends JFrame implements ActionListener{
JTextField tfunits;
JButton next;
JLabel lblname, labeladdress;
Choice meternumber, cmonth;
CalculateBill() {
setSize(600, 500);
setLocation(400, 150);
try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from customer");
while(rs.next()) {
meternumber.add(rs.getString("meter_no"));
}
} catch (Exception e)
{}
28
try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from customer where meter_no =
'"+meternumber.getSelectedItem()+"'");
while(rs.next()) {
lblname.setText(rs.getString("name"));
labeladdress.setText(rs.getString("address"));
}
} catch (Exception e) {
}
meternumber.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ie) {
try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from customer where meter_no =
'"+meternumber.getSelectedItem()+"'");
while(rs.next()) {
lblname.setText(rs.getString("name"));
labeladdress.setText(rs.getString("address"));
}
} catch (Exception e) {
}
}
});
setLayout(new BorderLayout());
add(p, "Center");
29
getContentPane().setBackground(new Color(0X78DEC7));
setVisible(true);
}
30
lblname.setFont(new Font("MV Boli", Font.BOLD, 15));
lblname.setBounds(100, 60, 100, 40);
add(lblname);
try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from customer where meter_no = '"+meter+"'");
while(rs.next()) {
name.setText(rs.getString("name"));
meternumber.setText(rs.getString("meter_no"));
}
} catch (Exception e) {
}
setVisible(true);
}
public static void main(String[] args) {
new ViewInformation("");
}
}
31
Conclusion:
Electricity Billing System project reports Before suggesting this solution they
were using a manual process on meter reading, amount calculation, and billing
customer and so on. The interaction between customer and Electricity Board
was very poor and it took much longer to respond to customer queries.
References:
https://chat.openai.com/
https://itsourcecode.com/
https://www.youtube.com/
32