0% found this document useful (0 votes)
66 views

Laraib Aslam Report Final

The document discusses an electricity billing system project. It aims to computerize the billing process to make it more efficient and accurate compared to the previous manual system. The document outlines features of the system like customer registration, bill generation and payment, admin access and reports. It also identifies problems with the old system and objectives of the new system.

Uploaded by

vishutripathi12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Laraib Aslam Report Final

The document discusses an electricity billing system project. It aims to computerize the billing process to make it more efficient and accurate compared to the previous manual system. The document outlines features of the system like customer registration, bill generation and payment, admin access and reports. It also identifies problems with the old system and objectives of the new system.

Uploaded by

vishutripathi12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 111

Travel and Tourism

Submitted in partial fulfilment for the award of

MASTER OF COMPUTER APPLICATIONS

Session: 2023-24

Vishal Tripathi

2200110140129

Under the guidance of

Ashutosh Pandey

UNITED INSTITUTE OF MANAGEMENT (011)

AFFILIATED TO

Dr. A.P.J. Abdul Kalam Technical University (APJAKTU), LUCKNOW


TRAVEL AND TOURISM 2023

INDEX

Certificate of Originality

I hereby declare that the Project entitled “Travel and Tourism” submitted to the
Department of Computer Application, UNITED INSTITUTE OF
MANAGEMENT, NAINI, PRAYAGRAJ in partial fulfilment for the award of the
Degree of MASTER IN COMPUTER APPLICATION during session 2022-2023
is an authentic record of my own work carried out under the guidance of “Dr.
Ashutosh Pandey” and that the Project has not previously formed the basis for the
award of any other degree.

This is to certify that the above statement made by me is correct to the best of my
knowledge.

Place:

Date: Signature of the candidate.

Vishal Tripathi

220110140129

1|Page
TRAVEL AND TOURISM 2023

Acknowledgement

I am very grateful to my project guide/mentor Mr Ashutosh Pandey for giving his


valuable time and constructive guidance in preparing the Synopsis/Project. His useful
advice and suggestions were really helpful to me during the project’s completion. In
this aspect, I am eternally grateful to you.

I would also like express my profound gratitude to our Principal Mr K.K Malviya,
HOD of MCA department Dr Awneesh Gupta and Our Project Head Mr. Dhananjay
Kumar Singh for their contribution to the completion of my project “Travel and
Tourism”.

It would not have been possible to complete this project in short period of time
without his kind encouragement and valuable guidance.

Date: Signature

Vishal Tripathi

2|Page
TRAVEL AND TOURISM 2023

INTRODUCTION

Electricity Billing System is a software-based application.

 This project aims at serving the department of electricity by computerizing the


billing system.
 It mainly focuses on the calculation of units consumed during the specified time
and the money to be charged by the electricity offices.
 This computerized system will make the overall billing system easy, accessible,
comfortable, and effective for consumers.

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.

The system excludes the need of maintaining paper electricity bill, administrator does
not have to keep a manual track of the users, and users can pay the amount without
visiting the office. Thus, it saves human efforts and resources

3|Page
TRAVEL AND TOURISM 2023

Features

• Customer Registration: New customers can easily register their accounts,


providing necessary personal information and meter type details.

• Profile Management: Customers can update their contact information and


address details as needed, ensuring up-to-date records.

• Bill Generation: The system supports the creation of electricity bills for
various meter types, including Normal, Business, Solar, and Smart meters.
Customized billing calculations based on meter type and consumption for
accurate charges.

• Bill Viewing: Customers can access and view their current and historical
electricity bills, including detailed breakdowns of consumption, charges, and
due dates.

• Admin Access: Administrators could manage all customer accounts, add new
customers, and update their information for efficient customer service.

• Online Payment: Secure online payment options are available, allowing


customers to conveniently pay their bills without the need for physical
transactions.

• Payment Status Monitoring: Admins can monitor the payment status of all
generated bills, helping to keep track of outstanding payments and ensuring
timely collections

4|Page
TRAVEL AND TOURISM 2023

Problem Identification and Objective


Identification of Problem:

 The old manual system was suffering from a series of drawbacks. Since whole of
the system was to be maintained with hands the process of keeping, maintaining
and retrieving the information was very tedious and lengthy.
 The records were never used to be in a systematic order.
 If any information was to be found it was required to go through the different
registers, documents there would never exist anything like report generation.
There would always be unnecessary consumption of time while entering records
and retrieving records.
 One more problem was that it was very difficult to find errors while entering the
records. Once the records were entered it was very difficult to update these
records. In present, work done in the electricity board is performed manually
which is a great headache for the department.
 The reason behind it is that there is lot of information to be maintained and have
to be kept in mind while running the business. For this reason we have provided
features Present system is partially automated (computerized), actually existing
system is quite laborious as one has to enter same information at three different
places.
 With the implementation of computerized system, the task of keeping records in
an organized manner will be solved. The greatest of all is the retrieval of
information, which will be at the click of the mouse. So the proposed system helps
in saving the time in different operations and making information flow easy giving
valuable reports.

5|Page
TRAVEL AND TOURISM 2023

Objectives
The electricity billing system has been developed to override the problems prevailing
in the practicing manual system. This software is supported to eliminate and in some
cases reduce the hardship faced by this existing system.
The firm handles all of the work manually, which is very tedious and mismanaged.
The objective of our project is as follows:
 To keep the information of Customer.
 To keep the information of consuming unit of energy of current month.
 To keep the information of consuming unit of energy of previous
month.
 To keep the information of employee working in the department.
 To maintain the record of the department

Advantages over previous systems

• Automation: The system automates the entire billing process, reducing


manual errors and processing time.

• Customization: Different types of meters, including Solar and Smart meters,


are supported, allowing for tailored billing based on meter types and usage.

• Online Payments: The inclusion of online payment options makes the system
more customer-friendly and reduces the need for physical transactions.

• Efficient Monitoring: Admins can easily monitor customer accounts and


payment statuses, facilitating better control and decision-making.

6|Page
TRAVEL AND TOURISM 2023

System Analysis
System Analysis is the study of a problem domain in order to recommend
improvements and specify requirements and priorities to achieve the solution. This
phase focused on a more detailed understanding of the problem.

• Gather, analyse, and validate the information.


• Define the requirements and prototypes for new system.
• Evaluate the alternatives and prioritize the requirements.
• Examine the information needs of end-user and enhances the system goal.

A Software Requirement Specification (SRS) document, which specifies the


software, hardware, functional, and network requirements of the system is prepared at
the end of this phase.

The goal of analysis is to determine where the problem is, in an attempt to fix the
system. This step involves breaking down the system in different pieces to analyse
the situation, analysing project goals, breaking down what needs to be created, and
attempting to engage users so that definite requirements can be defined.

2.1 Identification of Need

Needs identification is the process of discovering a customer's requirements,


constraints, pain points and motivations. It is a basic personal selling technique that is
used to understand how your products will be of value to the customer. This
information is then used to develop a proposal, pitch, negotiate and close the sale.
The following are illustrative examples of need identification.

7|Page
TRAVEL AND TOURISM 2023

1. Stakeholder analysis

The topic on this subject (Part II - topic 2) clearly indicates how important it is to
identify all possible stakeholders with an interest in the training process, including the
identification and assessment of the training needs. Stakeholder analysis in the
context of needs assessment will reveal the importance and possible influence of the
stakeholders in TNA, their type of Participation, interest and possible impact on
them.

2. Selecting and using the research methods to identify training needs

Identifying training needs is a form of research. First, evidence suggests that there is
a basic problem which can be addressed through training. It may also be necessary to
address the problem with non-training measures. So it is important to identify clearly
the training gap. This is found by comparing an existing situation with a future,
desirable situation, and then finding out how training can bring us from here to there.
Various methods may be used to do this, including the following:

• Self-report questionnaires
• Observation
• Individual interviews
• Checklist / job description
• Diary records
• work sampling
• Technical expert conference
• Critical incident
• Examination of existing records

8|Page
TRAVEL AND TOURISM 2023

3. Planning identification of organizational needs

• List organizations with a stake in the training.


• List questions to ask them, e.g. what are the critical changes affecting the work
and operations of the organization? What are the relevant policies within the
organization?

What are the current strengths and weaknesses of the organization? What
opportunities and threats are being presented from the external environment? Etc.

4. Planning identification of job needs

This should be carried out using a participatory methodology, ideally with the
trainees themselves, prior to the training, or with other stakeholders who are able to
provide good quality information about the professional activities of the target group.

The following steps are recommended:

• Identify main categories of jobs and make a list of all the tasks associated with
a person in that category of job.
• Using interviews, questionnaires or through observation of people performing
tasks, complete this frequency/ importance/ learning difficulty table.

Feasibility study
A feasibility study assesses the operational, technical and economic merits of the
proposed project. The feasibility study is intended to be a preliminary review of the
facts to see if it is worthy of proceeding to the analysis phase. From the systems
analyst perspective, the feasibility analysis is the primary tool for recommending
whether to proceed to the next phase or to discontinue the project.

9|Page
TRAVEL AND TOURISM 2023

The feasibility study is a management-oriented activity. The objective of a feasibility


study is to find out if an information system project can be done and to suggest
possible alternative solutions.

Projects are initiated for two broad reasons:

• Problems that lend themselves to systems solutions


• Opportunities for improving through:
 Upgrading systems
 Altering systems
 Installing new systems

A feasibility study should provide management with enough information to decide:

• Whether the project can be done?


• Whether the final product will benefit its intended users and organization
• What are the alternatives among which a solution will be chosen?
• Is there a preferred alternative
• How beneficial or practical the development of an information system would
be to an organization?

And for the System to be act as worth-while it should pass through some test that
examine that it should proceed further or not. This series of test is commonly known
as feasibility study on the system and it plays a very vital role for every system
projects. Feasibility studies undergo four major analyses to predict the system to be
success and they are as follows: -

1. Technical Feasibility

2. Economic Feasibility

3. Operational Feasibility

10 | P a g e
TRAVEL AND TOURISM 2023

Technical Feasibility

A large part of determining resources has to do with assessing technical feasibility. It


considers the technical requirements of the proposed project. The technical
requirements are then compared to the technical capability of the organization. The
systems project is considered technically feasible if the internal technical capability is
sufficient to support the project requirement.

The analyst must find out whether current technical resources can be upgraded or
added to in a manner that fulfils the request under consideration. This is where the
expertise of system analysts is beneficial, since using their own experience and their
contact with vendors they will be able to answer the question of technical feasibility.

The essential questions that help in testing the operational feasibility of a system
include the following:

• Is the project feasible within the limits of current technology?


• Does the technology exist at all?
• Is it available within given resource constraints?
• Is it a practical proposition?
• Manpower- programmers, testers & debuggers
• Software and hardware
• Are the current technical resources sufficient for the new system?
• Can they be upgraded to provide to provide the level of technology necessary
for the new system?
• Do we possess the necessary technical expertise, and is the schedule
reasonable?
• Can the technology be easily applied to current problems?
• Does the technology have the capacity to handle the solution?
• Do we currently possess the necessary technology?

11 | P a g e
TRAVEL AND TOURISM 2023

Monsoon recommended life balance system deals with the modern technology
system that needs the well efficient technical system to run this project. All the
resource constrains must be in the favour of the better influence of the system.
Keeping all these facts in mind we had selected the favourable hardware and software
utilities to make it more feasible.

Economic Feasibility

Economic analysis could also be referred to as cost/benefit analysis. It is the most


frequently used method for evaluating the effectiveness of a new system. In economic
analysis the procedure is to determine the benefits and savings that are expected from
a candidate system and compare them with costs. If benefits outweigh costs, then the
decision is made to design and implement the system. An entrepreneur must
accurately weigh the cost versus benefits before taking an action.

Possible questions raised in economic analysis are:

• Is the system cost effective?


• Do benefits outweigh costs?
• The cost of doing full system study
• The cost of business employee time
• Estimated cost of hardware
• Estimated cost of software/software development
• Is the project possible, given the resource constraints?
• What are the savings that will result from the system?
• Cost of employees' time for study
• Cost of packaged software/software development
• Selection among alternative financing arrangements (rent/lease/purchase)

12 | P a g e
TRAVEL AND TOURISM 2023

The concerned business must be able to see the value of the investment it is
pondering before committing to an entire system study. If short-term costs are not
overshadowed by long-term gains or produce no immediate reduction in operating
costs, then the system is not economically feasible, and the project should not
proceed any further. If the expected benefits equal or exceed costs, the system can be
judged to be economically feasible. Economic analysis is used for evaluating the
effectiveness of the Proposed System.

The economic feasibility will review the expected costs to see if they are in-line with
the projected budget or if the project has an acceptable return on investment. At this
point, the projected costs will only be a rough estimate. The exact costs are not
required to determine economic feasibility. It is only required to determine if it is
feasible that the project costs will fall within the target budget or return on
investment. A rough estimate of the project schedule is required to determine if it
would be feasible to complete the systems project within a required timeframe. The
required timeframe would need to be set by the organization.

Cost Benefits analysis

It is the process of analysing the financial facts associated with the system
development projects performed when conducting a preliminary investigation. The
purpose of a cost/benefit analysis is to answer questions Such as:

• Is the project justified (because benefits outweigh costs)?


• Can the project be done, within given cost constraints?
• What is the minimal cost to attain a certain system?
• What is the preferred alternative, among candidate solutions?

13 | P a g e
TRAVEL AND TOURISM 2023

Operational Feasibility

Operational feasibility is a measure of how well a proposed system solves the


problems and takes advantage of the opportunities identified during scope definition
and how it satisfies the requirements identified in the requirements analysis phase of
system development.

Operational feasibility reviews the willingness of the organization to support the


proposed system. This is probably the most difficult of the feasibilities to gauge. In
order to determine this feasibility, it is important to understand the management
commitment to the proposed project. If the request was initiated by management, it is
likely that there is management support, and the system will be accepted and used.
However, it is also important that the employee base will be accepting of the change.
The operational feasibility is the one that will be used effectively after it has been
developed. If users have difficulty with a new system, it will not produce the
expected benefits. It measures the viability of a system in terms of the PIECES
framework. The PIECES framework can help in identifying operational problems to
be solved, and their urgency:

Performance –

• Does current mode of operation provide adequate throughput and response


time?
• -In comparison of the earlier process of maintaining data in the written mode
on that contrast this system plays a very important role in maintain the book
management system and makes the process of data entering so easier and user
friendly.

Information-

• Does current mode provide end users and managers with timely, pertinent,
accurate and usefully formatted information?
14 | P a g e
TRAVEL AND TOURISM 2023

• System provides end users and managers with timely, pertinent, accurate and
usefully formatted information. Since all the user related information is being
stored in the database against a unique user ID, it will provide for meaningful and
accurate data to the librarian. The information handling in the current system is
done manually. This results in scribbling of data and loss of validity of data.
• The information handling in the proposed system will be computerized and will
automatically update. The human errors will be minimal. The data can be easily
updated, modified when required and will be validated before the data is
processed into the system.

Economy –

• Does current mode of operation provide cost-effective information services to


the business? Could there be a reduction in costs and/or an increase in benefits?
• Determines whether the system offers adequate service level and capacity to
reduce the cost of the business or increase the profit of the business. The
deployment of the proposed - system, manual work will be reduced and will be
replaced by an IT savvy approach.

Moreover, it has also been shown in the economic feasibility report that the
recommended solution is definitely going to benefit the organization economically in
the long run.

In the existing system the data are stored in ledgers and filing cabinets which require
a lot of space and maintenance. Access to certain data can be restricted by creating
different levels of user accessibility.

Control –

• Does current mode of operation offer effective controls to protect against fraud
and to guarantee accuracy and security of data and information?

15 | P a g e
TRAVEL AND TOURISM 2023

• As its database does not contain any confidential information which can be
misused so on that contrast there should no use of any security corner for this
system.

Efficiency –

• Does current mode of operation makes maximum use of available resources,


including people, time, and flow of forms?
• Efficiency work is to ensure a proper workflow structure to store patient data; we
can ensure the proper utilization of all the resources. It determines whether the
system make maximum use of available resources including time, people, flow of
forms, minimum processing delay. In the current system a lot of time is wasted on
paperwork like making new records, updating records. The proposed system will
be a lot efficient in maintaining the record and easily fetching out the required
data.

Services-

 Does current mode of operation provide reliable service? Is it flexible and


expandable?
 The system is desirable and reliable services to those who need it and also whether
the system is flexible and expandable or not. The proposed system is very much
flexible for better efficiency and performance of the organization. The existing
system can provide service only to a limited number of users. There is very little
room for change and hardly any scope for expansion. The scalability of the
proposed system will be inexhaustible as the storage capacity of the system can be
increased as per requirement. This will provide a strong base for expansion. The
new system will provide a high level of flexibility.

16 | P a g e
TRAVEL AND TOURISM 2023

System design
Feasibility Study

A feasibility study assesses the operational, technical and economic merits of the
proposed project. The feasibility study is intended to be a preliminary review of the
facts to see if it is worthy of proceeding to the analysis phase. From the systems
analyst perspective, the feasibility analysis is the primary tool for recommending
whether to proceed to the next phase or to discontinue the project.

The feasibility study is a management-oriented activity. The objective of a feasibility


study is to find out if an information system project can be done and to suggest
possible alternative solutions.

Projects are initiated for two broad reasons:

• Problems that lend themselves to systems solutions

• Opportunities for improving through:

o Upgrading systems
o Altering systems
o Installing new systems

A feasibility study should provide management with enough information to decide:

• Whether the project can be done?


• Whether the final product will benefit its intended users and organization?
• What are the alternatives among which a solution will be chose?
• Is there a preferred alternative
• How beneficial or practical the development of an information system would be to
an organization?

17 | P a g e
TRAVEL AND TOURISM 2023

And for the System to be act as worth-while it should pass through some test that
examine that it should proceed further or not. This series of test is commonly known
as feasibility study on the system and it plays a very vital role for every system
projects. Feasibility studies undergo four major analyses to predict the system to be
success and they are as follows: -

 Technical Feasibility.
 Economic Feasibility
 Operational Feasibility

DFD (data Flow diagram)

DFD is the abbreviation for Data Flow Diagram. The flow of data of a system or a
process is represented by DFD. It also gives insight into the inputs and outputs of
each entity and the process itself. DFD does not have control flow and no loops or
decision rules are present. Specific operations depending on the type of data can be
explained by a flowchart. It is a graphical tool, useful for communicating with users,
managers and other personnel. It is useful for analysing existing as well as proposed
system.

It should be pointed out that a DFD is not a flowchart. In drawing the DFD, the
designer has to specify the major transforms in the path of the data flowing from the
input to the output. DFDs can be hierarchically organized, which helps in
progressively partitioning and analysing large systems.

It provides an overview of

 What data is system processes.


 What transformation are performed.
 What data are stored?
 What results are produced, etc.?

18 | P a g e
TRAVEL AND TOURISM 2023

Levels of DFD

DFD uses hierarchy to maintain transparency thus multilevel DFD’s can be created.
Levels of DFD are as follows:
 0-level DFD: It represents the entire system as a single bubble and provides an
overall picture of the system.
 1-level DFD: It represents the main functions of the system and how they interact
with each other.
 2-level DFD: It represents the processes within each function of the system and
how they interact with each other.
 3-level DFD: It represents the data flow within each process and how the data is
transformed and stored.

19 | P a g e
TRAVEL AND TOURISM 2023

ER- diagram (Entity-Relationship Diagram)

An entity relationship diagram (ERD) shows the relationships of entity sets stored in
a database. An entity in this context is an object, a component of data. An entity set is
a collection of similar entities. These entities can have attributes that define its
properties.

There are two reasons to create a database diagram. You’re either designing a new
schema or you need to document our existing structure.

If you have an existing database you need to document, you create a database
diagram using data directly from your database. You can export your data base
20 | P a g e
TRAVEL AND TOURISM 2023

structure as a CSV file (there are some scripts on how to do this here), then have a
program generate the ERD automatically.

• An ER diagram is a means of visualizing how the information a system


produces is related. There are five main components of an ERD:
• Entities, which are represented by rectangles. An entity is an object or concept
about which you want to store information.
• A weak entity is an entity that must defined by a foreign key relationship with
another entity as it cannot be uniquely identified by its own attributes alone.
• Actions, which are represented by diamond shapes, show how two entities
share information in the database.
• In some cases, entities can be self-linked. For example, employees can
supervise other employees.
• Attributes, which are represented by ovals. A key attribute is the unique,
distinguishing characteristic of the entity.
• A multivalued attribute can have more than one value. For example, an
employee entity can have multiple skill values.
• A derived attribute is based on another attribute. For example, an employee's
monthly salary is based on the employee's annual salary.
• Connecting lines, solid lines that connect attributes to show the relationships of
entities in the diagram.
• Cardinality specifies how many instances of an entity relate to one instance of
another entity. Ordinarily is also closely linked to cardinality.

21 | P a g e
TRAVEL AND TOURISM 2023

Figure given below describes the ER diagram of Electricity Billing System. It has 5
entities namely login, customer, tax, bill, and meter info. The entities have attributes
which are primary and foreign and attributes.

22 | P a g e
TRAVEL AND TOURISM 2023

Use case Diagram

23 | P a g e
TRAVEL AND TOURISM 2023

24 | P a g e
TRAVEL AND TOURISM 2023

Hardware and Software Requirements

Hardware Requirements

RAM: A computer with at least 2GB of RAM.

Storage: 2GB Storage space for the application and the database.

Processor: Intel Pentium or Higher

Connectivity: An internet connection for online payments.

Software Requirements

Operating System: Any platform supporting Java

JDK: Java Development Kit (JDK)

Database: MySQL Database Server

Libraries: Java Swing and AWT llibraries

IDE: Apache NetBeans

25 | P a g e
TRAVEL AND TOURISM 2023

Algorithm or pseudo code of implementation


Explanation of Algorithm or pseudo code of system:

 Start system
 Enter login name and password
 On clicking the login button
 Connect to database
 Query database to know whether user credentials are correct
 If not, deny access and return login page with an error message
 If correct, check if credentials for administrator
 If yes, allow login
 Set admin session, re-direct administrator to admin login page
 If no, allow login set user session
 Re-direct user to user home page

Algorithm or pseudo code of admin:

Login:

 This program will allow the admin to enter the username and password.
 If the entered credentials are correct, then the login will be successful otherwise
need to be signup.
 If admin forgets password, it can be retrieved by giving username and answer for
security question.
 After successful login the admin will be redirected to admin portal page where
he/she can do following activities.

26 | P a g e
TRAVEL AND TOURISM 2023

NewCustomer:

 This program will allow the admin to enter the customer details and automatically
generates unique meter number.
 If customer name, address, city, state, email and phone number is entered, insert
the values into customer
else print error
while next=true enter the meter_info details
else print meter_info error
 Submit the details of customer that has been entered by clicking onto next button.
 If we need to cancel the particulars that has been entered click onto cancel option.
 If we need to submit the particulars that has been entered click onto submit option.

CustomerDetails:

 This program will allow the admin to view customer details.


 If we need to print the particulars that has been viewed click onto print option.

DepositDetails:

 This program will allow the admin to view bill details. If we need to sort the
particulars based on meter_no and month.
 If we need to search the particulars that has been viewed click onto search option.
 If we need to print the particulars that has been viewed click onto print option.

TaxDetails:

 This program will allow the admin to add tax details. Insert the values into tax else
print error
 Submit the details of tax that has been entered by clicking onto submit button.
 If we need to cancel the particulars that has been entered click onto cancel option.
27 | P a g e
TRAVEL AND TOURISM 2023

CalculateBill:

 This program will allow the admin to calculate total_bill when units consumed are
inserted where meter_no and month is selected.

insert the values into bill else print error

 Submit the details of tax that has been entered by clicking onto submit button.
 If we need to cancel the particulars that has been entered click onto cancel option.

Algorithm or pseudocode of Customer:

Login:

 This program will allow the customer to enter the username and password. If the
entered credentials are correct, then the login will be successful otherwise need to
be signup with the meter_no which is given by admin.
 If customer forgets password, it can be retrieved by giving username and answer
for security question. After successful login the customer will be redirected to
customer portal page where he/she can do following activities.

UpdateInfo:

 This program will allow the customer to update the customer details. If customer
address, city, state, email and phone number is updated,

update the values into customer else print error

update the details of customer that has been updated by clicking onto update
button.

 If we need to cancel the particulars that has been updated, click onto back option.

28 | P a g e
TRAVEL AND TOURISM 2023

ViewInfo:

 This program will allow the customer to view his/her own details.
 If we need to go back from the particulars that has been viewed click onto back
option.

PayBill:

 This program will allow the customer to view bill details and redirects to pay
 The bill where status will be updated.
 If we need to cancel the particulars that has been viewed click onto back
option.
 If we need to pay the bill amount that has been viewed click onto pay option.

BillDetails:

 This program will allow the customer to view bill details.


 If we need to print the particulars that has been viewed click onto print option.

GenerateBill:

 This program will allow the customer to generate bill when meter_no and month
is selected.
 Generate the details by clicking on generate bill button.

29 | P a g e
TRAVEL AND TOURISM 2023

Screenshots
Splash Screen

Login page

30 | P a g e
TRAVEL AND TOURISM 2023

Signup page(Admin)

Signup page(Customer)

Main page(Admin)
31 | P a g e
TRAVEL AND TOURISM 2023

Main page(Customer)

NewCustomer Page
32 | P a g e
TRAVEL AND TOURISM 2023

Meter information page

Customer Details Page


33 | P a g e
TRAVEL AND TOURISM 2023

Calculate Bill page

View Information page

34 | P a g e
TRAVEL AND TOURISM 2023

Update information page

Bill Details Page

35 | P a g e
TRAVEL AND TOURISM 2023

Paybill page

Generate bill page

36 | P a g e
TRAVEL AND TOURISM 2023

Deposit Details

37 | P a g e
TRAVEL AND TOURISM 2023

Codes
38 | P a g e
TRAVEL AND TOURISM 2023

Splash.java

package electricity.bill.system;
import javax.swing.*;
import java.awt.*;

public class Splash extends JFrame implements Runnable {


Thread t;
Splash ( ){
ImageIcon i1= new ImageIcon (ClassLoader.getSystemResource ("icon/elect.jpg"));
Image i2 = i1.getImage ().getScaledInstance (730, 550,
Image.SCALE_DEFAULT);
ImageIcon i3= new ImageIcon (i2);
JLabel image= new JLabel (i3);
add (image);

setVisible(true);

int x=1;
for(int i=2; i<600; i+=4, x+=1){
setSize(i+x, i);
setLocation(775-((i+x)/2),400-(i/2));
try{
Thread.sleep(4);
}
catch(Exception e){
e.printStackTrace();

39 | P a g e
TRAVEL AND TOURISM 2023

}
}
t=new Thread(this);
t.start();
setVisible(true);
}
public void run(){
try{
Thread.sleep(1000);
setVisible(false);

new Login();
}
catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] agrs)
{
new Splash();
}
}

Login.java

40 | P a g e
TRAVEL AND TOURISM 2023

package electricity.bill.system;

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 loginin;
Login(){
super("Login Page");
getContentPane().setBackground(Color.white);
setLayout(null);

JLabel lblusername = new JLabel("UserName");


lblusername.setBounds(300,20,100,20);
add(lblusername);

username = new JTextField();


username.setBounds(400,20, 150, 20);
add(username);
JLabel lblpassward = new JLabel("Passward");
lblpassward.setBounds(300,60,100,20);

41 | P a g e
TRAVEL AND TOURISM 2023

add(lblpassward);

password = new JTextField();


password.setBounds(400,60, 150, 20);
add(password);

JLabel lbllogginas = new JLabel("Login As");


lbllogginas.setBounds(300,100,100,20);
add(lbllogginas);

loginin = new Choice();


loginin.add("Admin");
loginin.add("Customer");
loginin.setBounds(400, 100, 150, 20);
add(loginin);
ImageIcon i1= new ImageIcon(ClassLoader.getSystemResource("icon/login.png"));
Image i2= i1.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT);
login = new JButton("Login", new ImageIcon(i2));
login.setBounds(330, 160, 100, 20);
login.addActionListener(this);
add(login);
ImageIcon i3= new
ImageIcon(ClassLoader.getSystemResource("icon/cancel.jpg"));

Image i4= i3.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT);


cancel = new JButton("Cancel", new ImageIcon(i4));
cancel.setBounds(450, 160, 100, 20);
42 | P a g e
TRAVEL AND TOURISM 2023

cancel.addActionListener(this);
add(cancel);

ImageIcon i5= new ImageIcon(ClassLoader.getSystemResource("icon/signup.png"));


Image i6= i5.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT);
signup = new JButton("sign Up", new ImageIcon(i6));
signup.setBounds(390, 200, 100, 20);
signup.addActionListener(this);
add(signup);

ImageIcon i7= new ImageIcon(ClassLoader.getSystemResource("icon/second.jpg"));


Image i8= i7.getImage().getScaledInstance(250, 250, Image.SCALE_DEFAULT);
ImageIcon i9= new ImageIcon(i8);
JLabel image= new JLabel(i9);
image.setBounds(0, 0, 250, 250);
add(image);

setSize(640,300);
setLocation(400,200);
setVisible(true);
}

public void actionPerformed(ActionEvent ae){


if(ae.getSource()==login){
String susername = username.getText();
String spassword = password.getText();

43 | P a g e
TRAVEL AND TOURISM 2023

String user=loginin.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 Project(user, meter);
}else{
JOptionPane.showMessageDialog(null, "Invalid Login");
username.setText("");
password.setText("");

}catch(Exception e){
e.printStackTrace();
}
}
else if(ae.getSource()== cancel){
setVisible(false);
}
44 | P a g e
TRAVEL AND TOURISM 2023

else if(ae.getSource()==signup){
setVisible(false);

new Signup();
}
}

public static void main(String[] args){


new Login();
}
}

signup.java

package electricity.bill.system;

import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

public class Signup extends JFrame implements ActionListener{

JButton create, back;


Choice accountType;
45 | P a g e
TRAVEL AND TOURISM 2023

JTextField meter, username, name, password;


Signup(){

setBounds(450, 150, 700, 400);


getContentPane().setBackground(Color.WHITE);
setLayout(null);

JPanel panel = new JPanel();


panel.setBounds(30, 30, 650, 300);
panel.setBorder(new TitledBorder(new LineBorder(new Color(173, 216, 230), 2),
"Create-Account", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(172,
216, 230)));
panel.setBackground(Color.WHITE);
panel.setLayout(null);
panel.setForeground(new Color(34, 139, 34));
add(panel);

JLabel heading = new JLabel("Create Account As");


heading.setBounds(100, 50, 140, 20);
heading.setForeground(Color.GRAY);
heading.setFont(new Font("Tahoma", Font.BOLD, 14));
panel.add(heading);
accountType = new Choice();
accountType.add("Admin");
accountType.add("Customer");
accountType.setBounds(260, 50, 150, 20);
panel.add(accountType);
46 | P a g e
TRAVEL AND TOURISM 2023

JLabel lblmeter = new JLabel("Meter Number");


lblmeter.setBounds(100, 90, 140, 20);
lblmeter.setForeground(Color.GRAY);
lblmeter.setFont(new Font("Tahoma", Font.BOLD, 14));
lblmeter.setVisible(false);
panel.add(lblmeter);

meter = new JTextField();


meter.setBounds(260, 90, 150, 20);
meter.setVisible(false);
panel.add(meter);

JLabel lblusername = new JLabel("Username");


lblusername.setBounds(100, 130, 140, 20);
lblusername.setForeground(Color.GRAY);
lblusername.setFont(new Font("Tahoma", Font.BOLD, 14));
panel.add(lblusername);

username = new JTextField();


username.setBounds(260, 130, 150, 20);
panel.add(username);

JLabel lblname = new JLabel("Name");


lblname.setBounds(100, 170, 140, 20);
lblname.setForeground(Color.GRAY);

47 | P a g e
TRAVEL AND TOURISM 2023

lblname.setFont(new Font("Tahoma", Font.BOLD, 14));


panel.add(lblname);

name = new JTextField();


name.setBounds(260, 170, 150, 20);
panel.add(name);

meter.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent fe) {}

@Override
public void focusLost(FocusEvent fe) {
try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from login where
meter_no = '"+meter.getText()+"'");
while(rs.next()) {
name.setText(rs.getString("name"));
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
JLabel lblpassword = new JLabel("Password");

48 | P a g e
TRAVEL AND TOURISM 2023

lblpassword.setBounds(100, 210, 140, 20);


lblpassword.setForeground(Color.GRAY);
lblpassword.setFont(new Font("Tahoma", Font.BOLD, 14));
panel.add(lblpassword);

password = new JTextField();


password.setBounds(260, 210, 150, 20);
panel.add(password);

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);
}
}
});

create = new JButton("Create");


create.setBackground(Color.BLACK);

49 | P a g e
TRAVEL AND TOURISM 2023

create.setForeground(Color.WHITE);
create.setBounds(140, 260, 120, 25);
create.addActionListener(this);
panel.add(create);

back = new JButton("Back");


back.setBackground(Color.BLACK);
back.setForeground(Color.WHITE);
back.setBounds(300, 260, 120, 25);
back.addActionListener(this);
panel.add(back);

ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("icon/signupImage.png"));
Image i2 = i1.getImage().getScaledInstance(250, 250, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(415, 30, 250, 250);
panel.add(image);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == create) {
String atype = accountType.getSelectedItem();

50 | P a g e
TRAVEL AND TOURISM 2023

String susername = username.getText();


String sname = name.getText();
String spassword = password.getText();
String smeter = meter.getText();

try {
Conn c = new Conn();

String query = null;


if (atype.equals("Admin")) {
query = "insert into login values('"+smeter+"', '"+susername+"',
'"+sname+"', '"+spassword+"', '"+atype+"')";
} else {
query = "update login set username = '"+susername+"', password =
'"+spassword+"', user = '"+atype+"' where meter_no = '"+smeter+"'";
}
c.s.executeUpdate(query);

JOptionPane.showMessageDialog(null, "Account Created Successfully");

setVisible(false);
new Login();
} catch (Exception e) {
e.printStackTrace();
}
} else if (ae.getSource() == back) {
setVisible(false);
51 | P a g e
TRAVEL AND TOURISM 2023

new Login();
}
}

public static void main(String[] args) {


new Signup();
}
}

project.java

package electricity.bill.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Paytm extends JFrame implements ActionListener{

String meter;
JButton back;
Paytm(String meter) {
this.meter = meter;
52 | P a g e
TRAVEL AND TOURISM 2023

JEditorPane j = new JEditorPane();


j.setEditable(false);

try {
j.setPage("https://paytm.com/online-payments");
} catch (Exception e) {
j.setContentType("text/html");
j.setText("<html>Could not load<html>");

JScrollPane pane = new JScrollPane(j);


add(pane);

back = new JButton("Back");


back.setBounds(640, 20, 80, 30);
back.addActionListener(this);
j.add(back);

setSize(800, 600);
setLocation(400, 150);
setVisible(true);

public void actionPerformed(ActionEvent ae) {


53 | P a g e
TRAVEL AND TOURISM 2023

setVisible(false);
new PayBill(meter);
}

public static void main(String[] args) {


new Paytm("");
}
}

Conn.java

package electricity.bill.system;
import java.sql.*;
public class Conn {

Connection c;
Statement s;
Conn() {
try {
c = DriverManager.getConnection("jdbc:mysql:///ebs", "root", "laraib786");
s = c.createStatement();
} catch (Exception e) {
e.printStackTrace();
}
}
54 | P a g e
TRAVEL AND TOURISM 2023

NewCustomer.java

package electricity.bill.system;

import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
55 | P a g e
TRAVEL AND TOURISM 2023

public class NewCustomer extends JFrame implements ActionListener{

JTextField tfname, tfaddress, tfstate, tfcity, tfemail, tfphone;


JButton next, cancel;
JLabel lblmeter;
NewCustomer(){
setSize(700, 500);
setLocation(400, 200);

JPanel p = new JPanel();


p.setLayout(null);
p.setBackground(new Color(173, 216, 230));
add(p);

JLabel heading = new JLabel("New Customer");


heading.setBounds(200, 10, 200, 25);
heading.setFont(new Font("Tahoma", Font.PLAIN, 24));
p.add(heading);

JLabel lblname = new JLabel("Customer Name");


lblname.setBounds(100, 80, 100, 20);
p.add(lblname);

tfname = new JTextField();


tfname.setBounds(240, 80, 200, 20);

56 | P a g e
TRAVEL AND TOURISM 2023

p.add(tfname);

JLabel lblmeterno = new JLabel("Meter Number");


lblmeterno.setBounds(100, 120, 100, 20);
p.add(lblmeterno);

lblmeter = new JLabel("");


lblmeter.setBounds(240, 120, 100, 20);
p.add(lblmeter);

Random ran = new Random();


long number = ran.nextLong() % 1000000;
lblmeter.setText("" + Math.abs(number));

JLabel lbladdress = new JLabel("Address");


lbladdress.setBounds(100, 160, 100, 20);
p.add(lbladdress);
tfaddress = new JTextField();
tfaddress.setBounds(240, 160, 200, 20);
p.add(tfaddress);

JLabel lblcity = new JLabel("City");


lblcity.setBounds(100, 200, 100, 20);
p.add(lblcity);

tfcity = new JTextField();

57 | P a g e
TRAVEL AND TOURISM 2023

tfcity.setBounds(240, 200, 200, 20);


p.add(tfcity);

JLabel lblstate = new JLabel("State");


lblstate.setBounds(100, 240, 100, 20);
p.add(lblstate);

tfstate = new JTextField();


tfstate.setBounds(240, 240, 200, 20);
p.add(tfstate);

JLabel lblemail = new JLabel("Email");


lblemail.setBounds(100, 280, 100, 20);
p.add(lblemail);

tfemail = new JTextField();


tfemail.setBounds(240, 280, 200, 20);
p.add(tfemail);

JLabel lblphone = new JLabel("Phone Number");


lblphone.setBounds(100, 320, 100, 20);
p.add(lblphone);

tfphone = new JTextField();


tfphone.setBounds(240, 320, 200, 20);
p.add(tfphone);

58 | P a g e
TRAVEL AND TOURISM 2023

next = new JButton("Next");


next.setBounds(120, 390, 100,25);
next.setBackground(Color.BLACK);
next.setForeground(Color.WHITE);
next.addActionListener(this);
p.add(next);

cancel = new JButton("Cancel");


cancel.setBounds(250, 390, 100,25);
cancel.setBackground(Color.BLACK);
cancel.setForeground(Color.WHITE);
cancel.addActionListener(this);
p.add(cancel);

setLayout(new BorderLayout());
add(p, "Center");

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icon/hicon1.jpg"));


Image i2 = i1.getImage().getScaledInstance(150, 300, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
add(image, "West");

getContentPane().setBackground(Color.WHITE);

59 | P a g e
TRAVEL AND TOURISM 2023

setVisible(true);

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == next) {
String name = tfname.getText();
String meter = lblmeter.getText();
String address = tfaddress.getText();
String city = tfcity.getText();
String state = tfstate.getText();
String email = tfemail.getText();
String phone = tfphone.getText();

String query1 = "insert into customer values('"+name+"', '"+meter+"',


'"+address+"', '"+city+"', '"+state+"', '"+email+"', '"+phone+"')";
String query2 = "insert into login values('"+meter+"', '', '"+name+"', '', '')";

try {
Conn c = new Conn();
c.s.executeUpdate(query1);
c.s.executeUpdate(query2);

JOptionPane.showMessageDialog(null, "Customer Details Added


Successfully");
setVisible(false);

60 | P a g e
TRAVEL AND TOURISM 2023

new MeterInfo(meter);
}
catch(Exception e){
e.printStackTrace();
}
}
else{
setVisible(false);
}
}

public static void main(String[] args){


new NewCustomer();
}
}

CustomeDetails.java

package electricity.bill.system;

import java.awt.*;
import javax.swing.*;
import java.sql.*;
import net.proteanit.sql.DbUtils;
import java.awt.event.*;

public class CustomerDetails extends JFrame implements ActionListener{


61 | P a g e
TRAVEL AND TOURISM 2023

Choice meternumber, cmonth;


JTable table;
JButton search, print;

CustomerDetails(){
super("Customer Details");

setSize(1200, 650);
setLocation(200, 150);

table = new JTable();

try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from customer");
table.setModel(DbUtils.resultSetToTableModel(rs));
} catch (Exception e) {
e.printStackTrace();
}

JScrollPane sp = new JScrollPane(table);


add(sp);

print = new JButton("Print");


print.addActionListener(this);

62 | P a g e
TRAVEL AND TOURISM 2023

add(print, "South");

setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
try {
table.print();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new CustomerDetails();
}
}

DepositDetail.java

package electricity.bill.system;

import java.awt.*;
import javax.swing.*;
import java.sql.*;
import net.proteanit.sql.DbUtils;
import java.awt.event.*;

public class DepositDetails extends JFrame implements ActionListener{


63 | P a g e
TRAVEL AND TOURISM 2023

Choice meternumber, cmonth;


JTable table;
JButton search, print;

DepositDetails(){
super("Deposit Details");

setSize(700, 700);
setLocation(400, 100);

setLayout(null);
getContentPane().setBackground(Color.WHITE);

JLabel lblmeternumber = new JLabel("Search By Meter Number");


lblmeternumber.setBounds(20, 20, 150, 20);
add(lblmeternumber);

meternumber = new Choice();


meternumber.setBounds(180, 20, 150, 20);
add(meternumber);

try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from customer");
while(rs.next()) {

64 | P a g e
TRAVEL AND TOURISM 2023

meternumber.add(rs.getString("meter_no"));
}
} catch (Exception e) {
e.printStackTrace();
}

JLabel lblmonth = new JLabel("Search By Month");


lblmonth.setBounds(400, 20, 100, 20);
add(lblmonth);

cmonth = new Choice();


cmonth.setBounds(520, 20, 150, 20);
cmonth.add("January");
cmonth.add("February");
cmonth.add("March");
cmonth.add("April");
cmonth.add("May");
cmonth.add("June");
cmonth.add("July");
cmonth.add("August");
cmonth.add("September");
cmonth.add("October");
cmonth.add("November");
cmonth.add("December");
add(cmonth);

65 | P a g e
TRAVEL AND TOURISM 2023

table = new JTable();

try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from bill");

table.setModel(DbUtils.resultSetToTableModel(rs));
} catch (Exception e) {
e.printStackTrace();
}

JScrollPane sp = new JScrollPane(table);


sp.setBounds(0, 100, 700, 600);
add(sp);

search = new JButton("Search");


search.setBounds(20, 70, 80, 20);
search.addActionListener(this);
add(search);

print = new JButton("Print");


print.setBounds(120, 70, 80, 20);
print.addActionListener(this);
add(print);

66 | P a g e
TRAVEL AND TOURISM 2023

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == search) {
String query = "select * from bill where meter_no =
'"+meternumber.getSelectedItem()+"' and month = '"+cmonth.getSelectedItem()+"'";

try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery(query);
table.setModel(DbUtils.resultSetToTableModel(rs));
} catch (Exception e) {

}
} else {
try {
table.print();
} catch (Exception e) {
e.printStackTrace();
}
}
}

public static void main(String[] args) {


new DepositDetails();

67 | P a g e
TRAVEL AND TOURISM 2023

}
}

CalculateBill.java

package electricity.bill.system;

import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import java.sql.*;

public class CalculateBill extends JFrame implements ActionListener{


JTextField tfname, tfaddress, tfstate, tfunits, tfemail, tfphone;
JButton next, cancel;
JLabel lblname, labeladdress;
Choice meternumber, cmonth;
CalculateBill() {
setSize(700, 500);
setLocation(400, 150);

JPanel p = new JPanel();


p.setLayout(null);
p.setBackground(new Color(173, 216, 230));
add(p);

68 | P a g e
TRAVEL AND TOURISM 2023

JLabel heading = new JLabel("Calculate Electricity Bill");


heading.setBounds(100, 10, 400, 25);
heading.setFont(new Font("Tahoma", Font.PLAIN, 24));
p.add(heading);

JLabel lblmeternumber = new JLabel("Meter Number");


lblmeternumber.setBounds(100, 80, 100, 20);
p.add(lblmeternumber);

meternumber = new Choice();

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) {
e.printStackTrace();
}

meternumber.setBounds(240, 80, 200, 20);


p.add(meternumber);

JLabel lblmeterno = new JLabel("Name");

69 | P a g e
TRAVEL AND TOURISM 2023

lblmeterno.setBounds(100, 120, 100, 20);


p.add(lblmeterno);

lblname = new JLabel("");


lblname.setBounds(240, 120, 100, 20);
p.add(lblname);

JLabel lbladdress = new JLabel("Address");


lbladdress.setBounds(100, 160, 100, 20);
p.add(lbladdress);

labeladdress = new JLabel();


labeladdress.setBounds(240, 160, 200, 20);
p.add(labeladdress);
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) {
e.printStackTrace();
}

70 | P a g e
TRAVEL AND TOURISM 2023

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) {
e.printStackTrace();
}
}
});
JLabel lblcity = new JLabel("Units Consumed");
lblcity.setBounds(100, 200, 100, 20);
p.add(lblcity);

tfunits = new JTextField();


tfunits.setBounds(240, 200, 200, 20);
p.add(tfunits);

JLabel lblstate = new JLabel("Month");


lblstate.setBounds(100, 240, 100, 20);
p.add(lblstate);

71 | P a g e
TRAVEL AND TOURISM 2023

cmonth = new Choice();


cmonth.setBounds(240, 240, 200, 20);
cmonth.add("January");
cmonth.add("February");
cmonth.add("March");
cmonth.add("April");
cmonth.add("May");
cmonth.add("June");
cmonth.add("July");
cmonth.add("August");
cmonth.add("September");
cmonth.add("October");
cmonth.add("November");
cmonth.add("December");
p.add(cmonth);

next = new JButton("Submit");


next.setBounds(120, 350, 100,25);
next.setBackground(Color.BLACK);
next.setForeground(Color.WHITE);
next.addActionListener(this);
p.add(next);

cancel = new JButton("Cancel");


cancel.setBounds(250, 350, 100,25);

72 | P a g e
TRAVEL AND TOURISM 2023

cancel.setBackground(Color.BLACK);
cancel.setForeground(Color.WHITE);
cancel.addActionListener(this);
p.add(cancel);

setLayout(new BorderLayout());

add(p, "Center");

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icon/hicon2.jpg"));


Image i2 = i1.getImage().getScaledInstance(150, 300, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
add(image, "West");

getContentPane().setBackground(Color.WHITE);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == next) {
String meter = meternumber.getSelectedItem();
String units = tfunits.getText();
String month = cmonth.getSelectedItem();

73 | P a g e
TRAVEL AND TOURISM 2023

int totalbill = 0;
int unit_consumed = Integer.parseInt(units);

String query = "select * from tax";

try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery(query);

while(rs.next()) {
totalbill += unit_consumed * Integer.parseInt(rs.getString("cost_per_unit"));
totalbill += Integer.parseInt(rs.getString("meter_rent"));
totalbill += Integer.parseInt(rs.getString("service_charge"));
totalbill += Integer.parseInt(rs.getString("service_tax"));
totalbill += Integer.parseInt(rs.getString("swacch_bharat_cess"));
totalbill += Integer.parseInt(rs.getString("fixed_tax"));
}
} catch (Exception e) {
e.printStackTrace();
}

String query2 = "insert into bill values('"+meter+"', '"+month+"', '"+units+"',


'"+totalbill+"','Not Paid')";

try {
Conn c = new Conn();

74 | P a g e
TRAVEL AND TOURISM 2023

c.s.executeUpdate(query2);

JOptionPane.showMessageDialog(null, "Customer Bill Updated Successfully");


setVisible(false);
} catch (Exception e) {
e.printStackTrace();
}
} else {
setVisible(false);
}
}
public static void main(String[] args) {
new CalculateBill();
}
}

ViewInformation.java

package electricity.bill.system;

import javax.swing.*;
import java.awt.*;
import java.sql.*;
import java.awt.event.*;

public class ViewInformation extends JFrame implements ActionListener{

75 | P a g e
TRAVEL AND TOURISM 2023

JButton cancel;
ViewInformation(String meter) {
setBounds(350, 150, 850, 650);
getContentPane().setBackground(Color.WHITE);
setLayout(null);

JLabel heading = new JLabel("VIEW CUSTOMER INFORMATION");


heading.setBounds(250, 0, 500, 40);
heading.setFont(new Font("Tahoma", Font.PLAIN, 20));
add(heading);

JLabel lblname = new JLabel("Name");


lblname.setBounds(70, 80, 100, 20);
add(lblname);

JLabel name = new JLabel("");


name.setBounds(250, 80, 100, 20);
add(name);

JLabel lblmeternumber = new JLabel("Meter Number");


lblmeternumber.setBounds(70, 140, 100, 20);
add(lblmeternumber);

JLabel meternumber = new JLabel("");


meternumber.setBounds(250, 140, 100, 20);

76 | P a g e
TRAVEL AND TOURISM 2023

add(meternumber);

JLabel lbladdress = new JLabel("Address");


lbladdress.setBounds(70, 200, 100, 20);
add(lbladdress);

JLabel address = new JLabel("");


address.setBounds(250, 200, 100, 20);
add(address);

JLabel lblcity = new JLabel("City");


lblcity.setBounds(70, 260, 100, 20);
add(lblcity);

JLabel city = new JLabel("");


city.setBounds(250, 260, 100, 20);
add(city);

JLabel lblstate = new JLabel("State");


lblstate.setBounds(500, 80, 100, 20);
add(lblstate);

JLabel state = new JLabel("");


state.setBounds(650, 80, 100, 20);
add(state);

77 | P a g e
TRAVEL AND TOURISM 2023

JLabel lblemail = new JLabel("Email");


lblemail.setBounds(500, 140, 100, 20);
add(lblemail);

JLabel email = new JLabel("");


email.setBounds(650, 140, 100, 20);
add(email);

JLabel lblphone = new JLabel("Phone");


lblphone.setBounds(500, 200, 100, 20);
add(lblphone);

JLabel phone = new JLabel("");


phone.setBounds(650, 200, 100, 20);
add(phone);

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"));
address.setText(rs.getString("address"));
city.setText(rs.getString("city"));
state.setText(rs.getString("state"));
email.setText(rs.getString("email"));

78 | P a g e
TRAVEL AND TOURISM 2023

phone.setText(rs.getString("phone"));
meternumber.setText(rs.getString("meter_no"));
}
} catch (Exception e) {
e.printStackTrace();
}

cancel = new JButton("Cancel");


cancel.setBackground(Color.BLACK);
cancel.setForeground(Color.WHITE);
cancel.setBounds(350, 340, 100, 25);
add(cancel);
cancel.addActionListener(this);
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("icon/viewcustomer.jpg"));
Image i2 = i1.getImage().getScaledInstance(600, 300, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(20, 350, 600, 300);
add(image);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


setVisible(false);

79 | P a g e
TRAVEL AND TOURISM 2023

public static void main(String[] args) {


new ViewInformation("");
}
}

UpadateInformation.java

package electricity.bill.system;
import javax.swing.*;
import java.awt.*;
import java.sql.*;
import java.awt.event.*;

public class UpdateInformation extends JFrame implements ActionListener{

JTextField tfaddress, tfstate, tfcity, tfemail, tfphone;


JButton update, cancel;
String meter;
JLabel name;
UpdateInformation(String meter) {
this.meter = meter;
setBounds(300, 150, 1050, 450);
getContentPane().setBackground(Color.WHITE);
80 | P a g e
TRAVEL AND TOURISM 2023

setLayout(null);

JLabel heading = new JLabel("UPDATE CUSTOMER INFORMATION");


heading.setBounds(110, 0, 400, 30);
heading.setFont(new Font("Tahoma", Font.PLAIN, 20));
add(heading);

JLabel lblname = new JLabel("Name");


lblname.setBounds(30, 70, 100, 20);
add(lblname);

name = new JLabel("");


name.setBounds(230, 70, 200, 20);
add(name);

JLabel lblmeternumber = new JLabel("Meter Number");


lblmeternumber.setBounds(30, 110, 100, 20);
add(lblmeternumber);

JLabel meternumber = new JLabel("");


meternumber.setBounds(230, 110, 200, 20);
add(meternumber);

JLabel lbladdress = new JLabel("Address");


lbladdress.setBounds(30, 150, 100, 20);
add(lbladdress);

81 | P a g e
TRAVEL AND TOURISM 2023

tfaddress = new JTextField();


tfaddress.setBounds(230, 150, 200, 20);
add(tfaddress);

JLabel lblcity = new JLabel("City");


lblcity.setBounds(30, 190, 100, 20);
add(lblcity);

tfcity = new JTextField();


tfcity.setBounds(230, 190, 200, 20);
add(tfcity);

JLabel lblstate = new JLabel("State");


lblstate.setBounds(30, 230, 100, 20);
add(lblstate);

tfstate = new JTextField();


tfstate.setBounds(230, 230, 200, 20);
add(tfstate);

JLabel lblemail = new JLabel("Email");


lblemail.setBounds(30, 270, 100, 20);
add(lblemail);

tfemail = new JTextField();

82 | P a g e
TRAVEL AND TOURISM 2023

tfemail.setBounds(230, 270, 200, 20);


add(tfemail);

JLabel lblphone = new JLabel("Phone");


lblphone.setBounds(30, 310, 100, 20);
add(lblphone);

tfphone = new JTextField();


tfphone.setBounds(230, 310, 200, 20);
add(tfphone);

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"));
tfaddress.setText(rs.getString("address"));
tfcity.setText(rs.getString("city"));
tfstate.setText(rs.getString("state"));
tfemail.setText(rs.getString("email"));
tfphone.setText(rs.getString("phone"));
meternumber.setText(rs.getString("meter_no"));
}
} catch (Exception e) {
e.printStackTrace();

83 | P a g e
TRAVEL AND TOURISM 2023

update = new JButton("Update");


update.setBackground(Color.BLACK);
update.setForeground(Color.WHITE);
update.setBounds(70, 360, 100, 25);
add(update);
update.addActionListener(this);

cancel = new JButton("Cancel");


cancel.setBackground(Color.BLACK);
cancel.setForeground(Color.WHITE);
cancel.setBounds(230, 360, 100, 25);
add(cancel);
cancel.addActionListener(this);
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("icon/update.jpg"));
Image i2 = i1.getImage().getScaledInstance(400, 300,
Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(550, 50, 400, 300);
add(image);

setVisible(true);
}
84 | P a g e
TRAVEL AND TOURISM 2023

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == update) {
String address = tfaddress.getText();
String city = tfcity.getText();
String state = tfstate.getText();
String email = tfemail.getText();
String phone = tfphone.getText();

try {
Conn c = new Conn();
c.s.executeUpdate("update customer set address = '"+address+"', city =
'"+city+"', state = '"+state+"', email = '"+email+"', phone = '"+phone+"' where
meter_no = '"+meter+"'");
JOptionPane.showMessageDialog(null, "User Information Updated Successfully");
setVisible(false);
} catch (Exception e) {
e.printStackTrace();
}
} else {
setVisible(false);
}
}

public static void main(String[] args) {


new UpdateInformation("");
}
85 | P a g e
TRAVEL AND TOURISM 2023

PayBill.java
package electricity.bill.system;

import javax.swing.*;
import java.awt.*;
import java.sql.*;
import java.awt.event.*;

public class PayBill extends JFrame implements ActionListener{


Choice cmonth;
JButton pay, back;
String meter;
PayBill(String meter) {
this.meter = meter;
setLayout(null);
setBounds(300, 150, 900, 600);

JLabel heading = new JLabel("Electicity Bill");


heading.setFont(new Font("Tahoma", Font.BOLD, 24));
heading.setBounds(120, 5, 400, 30);
add(heading);

86 | P a g e
TRAVEL AND TOURISM 2023

JLabel lblmeternumber = new JLabel("Meter Number");


lblmeternumber.setBounds(35, 80, 200, 20);
add(lblmeternumber);

JLabel meternumber = new JLabel("");


meternumber.setBounds(300, 80, 200, 20);
add(meternumber);

JLabel lblname = new JLabel("Name");


lblname.setBounds(35, 140, 200, 20);
add(lblname);

JLabel labelname = new JLabel("");


labelname.setBounds(300, 140, 200, 20);
add(labelname);

JLabel lblmonth = new JLabel("Month");


lblmonth.setBounds(35, 200, 200, 20);
add(lblmonth);

cmonth = new Choice();


cmonth.setBounds(300, 200, 200, 20);
cmonth.add("January");
cmonth.add("February");
cmonth.add("March");
cmonth.add("April");

87 | P a g e
TRAVEL AND TOURISM 2023

cmonth.add("May");
cmonth.add("June");
cmonth.add("July");
cmonth.add("August");
cmonth.add("September");
cmonth.add("October");
cmonth.add("November");
cmonth.add("December");
add(cmonth);

JLabel lblunits = new JLabel("Units");


lblunits.setBounds(35, 260, 200, 20);
add(lblunits);

JLabel labelunits = new JLabel("");


labelunits.setBounds(300, 260, 200, 20);
add(labelunits);

JLabel lbltotalbill = new JLabel("Total Bill");


lbltotalbill.setBounds(35, 320, 200, 20);
add(lbltotalbill);

JLabel labeltotalbill = new JLabel("");


labeltotalbill.setBounds(300, 320, 200, 20);
add(labeltotalbill);

88 | P a g e
TRAVEL AND TOURISM 2023

JLabel lblstatus = new JLabel("Status");


lblstatus.setBounds(35, 380, 200, 20);
add(lblstatus);

JLabel labelstatus = new JLabel("");


labelstatus.setBounds(300, 380, 200, 20);
labelstatus.setForeground(Color.RED);
add(labelstatus);

try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from customer where meter_no =
'"+meter+"'");
while(rs.next()) {
meternumber.setText(meter);
labelname.setText(rs.getString("name"));
}

rs = c.s.executeQuery("select * from bill where meter_no = '"+meter+"' AND month


= 'January'");
while(rs.next()) {
labelunits.setText(rs.getString("units"));
labeltotalbill.setText(rs.getString("totalbill"));
labelstatus.setText(rs.getString("status"));
}
} catch (Exception e) {
e.printStackTrace();
89 | P a g e
TRAVEL AND TOURISM 2023

cmonth.addItemListener(new ItemListener(){
@Override
public void itemStateChanged(ItemEvent ae) {
try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from bill where meter_no = '"+meter+"'
AND month = '"+cmonth.getSelectedItem()+"'");
while(rs.next()) {
labelunits.setText(rs.getString("units"));
labeltotalbill.setText(rs.getString("totalbill"));
labelstatus.setText(rs.getString("status"));
}
} catch (Exception e) {
e.printStackTrace();
}
}
});

pay = new JButton("Pay");


pay.setBackground(Color.BLACK);
pay.setForeground(Color.WHITE);
pay.setBounds(100, 460, 100, 25);
pay.addActionListener(this);

90 | P a g e
TRAVEL AND TOURISM 2023

add(pay);

back = new JButton("Back");


back.setBackground(Color.BLACK);
back.setForeground(Color.WHITE);
back.setBounds(230, 460, 100, 25);
back.addActionListener(this);
add(back);

getContentPane().setBackground(Color.WHITE);

ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("icon/bill.png"));
Image i2 = i1.getImage().getScaledInstance(600, 300,
Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(400, 120, 600, 300);
add(image);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == pay) {
try {
Conn c = new Conn();
91 | P a g e
TRAVEL AND TOURISM 2023

c.s.executeUpdate("update bill set status = 'Paid' where meter_no =


'"+meter+"' AND month='"+cmonth.getSelectedItem()+"'");
} catch (Exception e) {
e.printStackTrace();
}
setVisible(false);
new Paytm(meter);
} else {
setVisible(false);
}
}

public static void main(String[] args){


new PayBill("");
}
}

BillDeatils.java

package electricity.bill.system;
import javax.swing.*;
import java.awt.*;
import java.sql.*;
import net.proteanit.sql.DbUtils;

92 | P a g e
TRAVEL AND TOURISM 2023

public class BillDetails extends JFrame{

BillDetails(String meter) {

setSize(700, 650);
setLocation(400, 150);

getContentPane().setBackground(Color.WHITE);

JTable table = new JTable();

try {
Conn c = new Conn();
String query = "select * from bill where meter_no = '"+meter+"'";
ResultSet rs = c.s.executeQuery(query);

table.setModel(DbUtils.resultSetToTableModel(rs));
} catch (Exception e) {
e.printStackTrace();
}

JScrollPane sp = new JScrollPane(table);


sp.setBounds(0, 0, 700, 650);
add(sp);

setVisible(true);

93 | P a g e
TRAVEL AND TOURISM 2023

public static void main(String[] args) {


new BillDetails("");
}
}

GenerateBill.java
package electricity.bill.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

public class GenerateBill extends JFrame implements ActionListener{

String meter;
JButton bill;
Choice cmonth;
JTextArea area;
GenerateBill(String meter) {
this.meter = meter;

setSize(500, 700);
setLocation(550, 30);

94 | P a g e
TRAVEL AND TOURISM 2023

setLayout(new BorderLayout());

JPanel panel = new JPanel();

JLabel heading = new JLabel("Generate Bill");


JLabel meternumber = new JLabel(meter);

cmonth = new Choice();

cmonth.add("January");
cmonth.add("February");
cmonth.add("March");
cmonth.add("April");
cmonth.add("May");
cmonth.add("June");
cmonth.add("July");
cmonth.add("August");
cmonth.add("September");
cmonth.add("October");
cmonth.add("November");
cmonth.add("December");

area = new JTextArea(50, 15);


area.setText("\n\n\t--------Click on the---------\n\t Generate Bill Button to get\n\
tthe bill of the Selected Month");
area.setFont(new Font("Senserif", Font.ITALIC, 18));
95 | P a g e
TRAVEL AND TOURISM 2023

JScrollPane pane = new JScrollPane(area);

bill = new JButton("Generate Bill");


bill.addActionListener(this);

panel.add(heading);
panel.add(meternumber);
panel.add(cmonth);
add(panel, "North");

add(pane, "Center");
add(bill, "South");

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


try {
Conn c = new Conn();

String month = cmonth.getSelectedItem();

area.setText("\tLaraib Power Limited\nELECTRICITY BILL GENERATED


FOR THE MONTH\n\tOF "+month+", 2023\n\n\n");

96 | P a g e
TRAVEL AND TOURISM 2023

ResultSet rs = c.s.executeQuery("select * from customer where meter_no =


'"+meter+"'");

if(rs.next()) {
area.append("\n Customer Name: " + rs.getString("name"));
area.append("\n Meter Number : " + rs.getString("meter_no"));
area.append("\n Address : " + rs.getString("address"));
area.append("\n City : " + rs.getString("city"));
area.append("\n State : " + rs.getString("state"));
area.append("\n Email : " + rs.getString("email"));
area.append("\n Phone : " + rs.getString("phone"));
area.append("\n---------------------------------------------------");
area.append("\n");
}

rs = c.s.executeQuery("select * from meter_info where meter_no =


'"+meter+"'");

if(rs.next()) {
area.append("\n Meter Location: " + rs.getString("meter_location"));
area.append("\n Meter Type: " + rs.getString("meter_type"));
area.append("\n Phase Code: " + rs.getString("phase_code"));
area.append("\n Bill Type: " + rs.getString("bill_type"));
area.append("\n Days: " + rs.getString("days"));
area.append("\n---------------------------------------------------");
area.append("\n");
}
97 | P a g e
TRAVEL AND TOURISM 2023

rs = c.s.executeQuery("select * from tax");

if(rs.next()) {
area.append("\n");
area.append("\n Cost Per Unit: " + rs.getString("cost_per_unit"));
area.append("\n Meter Rent: " + rs.getString("cost_per_unit"));
area.append("\n Service Charge: " + rs.getString("service_charge"));
area.append("\n Service Tax: " + rs.getString("service_charge"));
area.append("\n Swacch Bharat Cess: "+
rs.getString("swacch_bharat_cess"));
area.append("\n Fixed Tax: " + rs.getString("fixed_tax"));
area.append("\n");
}

rs = c.s.executeQuery("select * from bill where meter_no = '"+meter+"' and


month='"+month+"'");

if(rs.next()) {
area.append("\n");
area.append("\n Current Month: " + rs.getString("month"));
area.append("\n Units Consumed: " + rs.getString("units"));
area.append("\n Total Charges: " + rs.getString("totalbill"));
area.append("\n-------------------------------------------------------");
area.append("\n Total Payable: " + rs.getString("totalbill"));
area.append("\n");
}
} catch (Exception e) {
98 | P a g e
TRAVEL AND TOURISM 2023

e.printStackTrace();
}
}

public static void main(String[] args) {


new GenerateBill("");
}
}

MeterInfo.java

package electricity.bill.system;

import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;

public class MeterInfo extends JFrame implements ActionListener{

JTextField tfname, tfaddress, tfstate, tfcity, tfemail, tfphone;


JButton next;
Choice meterlocation, metertype, phasecode, billtype;
String meternumber;
MeterInfo(String meternumber){
this.meternumber = meternumber;

99 | P a g e
TRAVEL AND TOURISM 2023

setSize(700, 500);
setLocation(400, 200);

JPanel p = new JPanel();


p.setLayout(null);
p.setBackground(new Color(173, 216, 230));
add(p);
JLabel heading = new JLabel("Meter Information");
heading.setBounds(200, 10, 200, 25);
heading.setFont(new Font("Tahoma", Font.PLAIN, 24));
p.add(heading);

JLabel lblname = new JLabel("Meter Number");


lblname.setBounds(100, 80, 100, 20);
p.add(lblname);

JLabel lblmeternumber = new JLabel(meternumber);


lblmeternumber.setBounds(240, 80, 100, 20);
p.add(lblmeternumber);

JLabel lblmeterlocation = new JLabel("Meter Location");


lblmeterlocation.setBounds(100, 120, 100, 20);
p.add(lblmeterlocation);

meterlocation = new Choice();


meterlocation.add("OutSide");

100 | P a g e
TRAVEL AND TOURISM 2023

meterlocation.add("InSide");
meterlocation.setBounds(240, 120, 200, 20);
p.add(meterlocation);

JLabel lblmetertype = new JLabel("Meter Type");


lblmetertype.setBounds(100, 160, 100, 20);
p.add(lblmetertype);

metertype = new Choice();


metertype.add("Elecric Meter");
metertype.add("Solar Meter");
metertype.add("Smart Meter");
metertype.setBounds(240, 160, 200, 20);
p.add(metertype);

JLabel lblphasecode = new JLabel("Phase Code");


lblphasecode.setBounds(100, 200, 100, 20);
p.add(lblphasecode);

phasecode = new Choice();


phasecode.add("011");
phasecode.add("022");
phasecode.add("033");
phasecode.add("044");
phasecode.add("055");
phasecode.add("066");

101 | P a g e
TRAVEL AND TOURISM 2023

phasecode.add("077");
phasecode.add("088");
phasecode.add("099");
phasecode.setBounds(240, 200, 200, 20);
p.add(phasecode);

JLabel lbltype = new JLabel("Bill Type");


lbltype.setBounds(100, 240, 100, 20);
p.add(lbltype);
billtype = new Choice();
billtype.add("Normal");
billtype.add("Industrial");
billtype.setBounds(240, 240, 200, 20);
p.add(billtype);

JLabel lbldays = new JLabel("Days");


lbldays.setBounds(100, 280, 100, 20);
p.add(lbldays);

JLabel lblday = new JLabel(" 30 Days");


lblday.setBounds(240, 280, 100, 20);
p.add(lblday);

JLabel lblnote = new JLabel("Note");


lblnote.setBounds(100, 320, 100, 20);
p.add(lblnote);

102 | P a g e
TRAVEL AND TOURISM 2023

JLabel lblnotes = new JLabel("By Deafult Bill is Calculated for 30 days only");
lblnotes.setBounds(240, 320, 400, 20);
p.add(lblnotes);

next = new JButton("Submit");


next.setBounds(220, 390, 100,25);
next.setBackground(Color.BLACK);
next.setForeground(Color.WHITE);
next.addActionListener(this);
p.add(next);
setLayout(new BorderLayout());
add(p, "Center");

ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("icon/hicon1.jpg"));
Image i2 = i1.getImage().getScaledInstance(150, 300,
Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
add(image, "West");

getContentPane().setBackground(Color.WHITE);

setVisible(true);

103 | P a g e
TRAVEL AND TOURISM 2023

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == next) {
String meter = meternumber;
String location = meterlocation.getSelectedItem();
String type = metertype.getSelectedItem();
String code = phasecode.getSelectedItem();
String typebill = billtype.getSelectedItem();
String days = "30";

String query = "insert into meter_info values('"+meter+"', '"+location+"',


'"+type+"', '"+code+"', '"+typebill+"', '"+days+"')";

try {
Conn c = new Conn();
c.s.executeUpdate(query);

JOptionPane.showMessageDialog(null, "Meter Information Added Successfully");


setVisible(false);
//new merter frame
}
catch(Exception e){
e.printStackTrace();
}
}
else{

104 | P a g e
TRAVEL AND TOURISM 2023

setVisible(false);
}
}
public static void main(String[] args){
new MeterInfo("");
}
}

Paytm.java

package electricity.bill.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Paytm extends JFrame implements ActionListener{

String meter;
JButton back;
Paytm(String meter) {
this.meter = meter;

JEditorPane j = new JEditorPane();


j.setEditable(false);

try {
105 | P a g e
TRAVEL AND TOURISM 2023

j.setPage("https://paytm.com/online-payments");
} catch (Exception e) {
j.setContentType("text/html");
j.setText("<html>Could not load<html>");
}

JScrollPane pane = new JScrollPane(j);


add(pane);

back = new JButton("Back");


back.setBounds(640, 20, 80, 30);
back.addActionListener(this);
j.add(back);

setSize(800, 600);
setLocation(400, 150);
setVisible(true);

public void actionPerformed(ActionEvent ae) {


setVisible(false);
new PayBill(meter);
}
public static void main(String[] args) {
new Paytm("");

106 | P a g e
TRAVEL AND TOURISM 2023

}
}

TESTING

Testing gives the outline of all the testing methods that are carried out to get a bug
free application.

Testing process

Testing is an integral part of software development. Testing process, in a way


certifies, whether the product, that is developed, compiles with the standards, that it
was designed to. Testing process involves building of test cases, against which, the
product has to be tested. In some cases, test cases are done based on the system
requirements specified for the product/software, which is to be developed.

Testing objectives

The main objectives of testing process are as follows:

• Testing is a process of executing a program with the intent of finding an


error.

• A good test case is one that has high probability of finding an as yet
undiscovered error.

• A successful test is one that uncovers an as yet undiscovered error.

107 | P a g e
TRAVEL AND TOURISM 2023

Levels of Testing

Different levels of testing are used in the testing process; each level of testing aims to
test different aspects of the system. The basic levels are unit testing, integration
testing, system testing and acceptance testing.

1. Unit Testing-

Unit testing focuses verification effort on the smallest unit of software design
the module. The software built, is a collection of individual modules. In this
kind of testing exact flow of control for each module was verified. With
detailed design consideration used as a guide, important control paths are
tested to uncover errors within the boundary of the module.

2. Integration Testing-

The second level of testing is called integration testing. In this, many class-
tested modules are combined into subsystems, which are then tested. The goal
here is to see if all the modules can be integrated properly. We have been
identified and debugged.

3. System testing-

Here the entire application is tested. The reference document for this process is
the requirement document, and the goal is to see IF the application meets its
requirements. Each module and component of ethereal was thoroughly tested
to remove bugs through a system testing strategy. Test cases were generated
for all possible input sequences and the output was verified for its correctness.
108 | P a g e
TRAVEL AND TOURISM 2023

FUTURE SCOPE AND LIMITATIONS

SOFTWARE SCOPE:

Extensibility: This software is extendable in ways that its original developers may
not expect. The following principles enhances extensibility like hide data structure,
avoid traversing multiple

Links or methods avoid case statements on object type and distinguish public and
private operations.

Reusability: Reusability is possible as and when require in this application. We can


update it next version. Reusable software reduces design, coding and testing cost by
amortizing effort over several designs. Reducing the amount of code also simplifies
understanding, which increases the likelihood that the code is correct. We follow up
both types of reusability:

Sharing of newly written code within a project and reuse of previously written code
on new projects.

Understand ability: A method is understandable if someone other than the creator of


the method can understand the code (as well as the creator after a time lapse). We use
the method, which small and coherent helps to accomplish this.

109 | P a g e
TRAVEL AND TOURISM 2023

Cost-effectiveness: Its cost is under the budget and make within given time period. It
is desirable to aim for a system with a minimum cost subject to the condition that it
must satisfy the entire requirement.

Scope of this document is to put down the requirements, clearly identifying the
information needed by the user, the source of the information and outputs expected
from the system.

LIMITATIONS:

This application cannot be accessed remotely.

• This application requires knowledgeable person to use this application.

• This application does not have journals.

References

 http://www.github.com
 www.stackoverflow.com
 www.google.com
 http://www.javatpoint.com/
 https://www.geeksforgeeks.org/

110 | P a g e

You might also like