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

ATM Simulator System

rrttt

Uploaded by

hors3110raj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views

ATM Simulator System

rrttt

Uploaded by

hors3110raj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 146

“……PROJECT TITLE…..


A PROJECT REPORT
SUBMITTED IN THE PARTIAL FULFILMENT OF THE REQUIREMENT
FOR THE AWARD OF THE DEGREE OF

MASTER OF COMPUTER APPLICATIONS (MCA).

PROJECT BY
NAME :-
ROLL NO :- 22MCA9266080
REGD. NO :- PG00144/2022
SESSION :- 2022-24

UNIVERSITY DEPARTMENT OF MATHEMATICS,


RANCHI UNIVERSITY, RANCHI
2022-2024

Page - 1 -
ABSTRACT

Page - 2 -
Now-a-days ATM (Automatic Teller Machines) is commonly used. It not only provides basic
transaction services (e.g.…withdraw, balance enquiry, mini statement, money transfer) but also
provide additional services like bill payments, mobile recharges, examination fees payment. But most
of these facilities are available only to the urban people and not to the rural people. The reason why
these facilities are not available to the rural people is illiteracy and the difficulty they face in
remembering the entire mechanism of handling an ATM machine. Our project aims at making the
ATM machines more user friendly (especially for rural people). And we are doing this by
constructing the simulator of real world ATM machine. As we know that simulator is a computerized
model of real world system that demonstrate the working of the real world system (on the basis of
certain assumptions) and can also be used to perform new experiments before it is deployed on the
real system. The technique by which we are going to make the simulator friendlier to rural people is
by enabling the simulator to be controlled by speech (i.e. any regional language).

So, in our project we are constructing a simulator that depicts the real world ATM machines and have
certain features which are as follows:

 Works in networked environment, to demonstrate the real world ATM working environment.

 Demonstrates the basic banking services provided by ATM machines, i.e.….withdraw,


deposit, balance enquiry, money transfer and others.

 Also, demonstrate the additional services provided by today‟s ATM machines, i.e. electricity
bill payment, telephone bill payment.

 Enabling the simulator to be controlled by speech is the experiment we are going to perform
on the simulator.

Page - 3 -
INTRODUCTION

Page - 4 -
PROBLEM STATEMENT:

The real world ATM is continuously developing day by day. More and more new and exciting
features are incorporated in the machine as per customer‟s increasing needs. In the earlier times ATM
was only recognized for cash withdrawal or balance enquiry. But now a day various new features like
cash deposits, various Bill payments, Mobile recharge etc are added which are attracting more and
more customers. In spite of these advancements in the ATM world, the ATM is not successful in
rural areas. Most of the people are illiterate and even can‟t perform a simple transaction like cash
withdrawal due to language bondations. The same problem exists with the blind people. Providing
more and more language options is useless because they may not be able to read a text written on the
screen. Thus the existing system although growing day by day and fulfilling more and more needs of
customers fails in the case when simplicity and user friendliness is measured.

AIM:
The aim of this project is to simulate the real world ATM machine.

STUDY OF CURRENT SYSTEM:

A real world automated teller machine (ATM) is a computerized telecommunications device that
provides the customers of a bank with access to financial transactions in a public space without the
need for a human clerk or bank teller. On most modern ATMs, the customer is identified by inserting
a plastic ATM card with a magnetic stripe or a plastic smartcard with a chip that contains a unique
card number, Bank account number and some security information, such as an expiration date or
CVC (CVV). Security is provided by the customer entering a personal identification number (PIN).

The real world ATM provides a keypad and a touch screen. There is cash dispensing machine from
which cash out can be accomplished. The cash dispensing machine optionally owns a cash In
mechanism (if cash deposit feature is enabled in ATM machine), from which user can deposit money
into his account. For customer‟s simplicity various language options are supported (like English,

Page - 5 -
Hindi etc). Various features provided by a real world ATM system are as follows:-

 Cash Withdrawal
 Cash Deposit
 Money Transfer
 Balance Enquiry
 Bill Payments

PROPOSED SYSTEM:

The proposed system “Speech controlled ATM Simulator” provides all the basic as well as advanced
features of a standard real world ATM system. Along with it to add more simplicity and to make the
machine more user friendly two new concepts are added:-

Speech Synthesis-The ATM system will now help the user by guiding him throughout the transaction
by giving speech in his or her mother language.

Speech Recognition- The ATM system will now be able to recognize spoken commands. The
customer can now give voice commands in his mother language with the help of a microphone and
the ATM machine recognizes those spoken commands and takes the appropriate action.

FEASIBILITY STUDY:

Feasibility is the determination of whether or not a project is worth doing. The process followed in
making this determination is called a feasibility study. It determines whether a project should be
taken or not. Feasibility study was undertaken within tight constraints of time and culminated in the
written and amoral feasibility reports. The constants of the reports were used as a sound basis for the
decision of proceeding, postponing or the cancellation of the project. Depending on the results of the
initial investigation the survey is expanded to a more detailed feasibility study. Feasibility study is a
test of a system proposal according to its workability, impact on the organization, ability to meet user
needs, and effective use of resources.

Page - 6 -
Various types of feasibility are studies they are:-

1) Technical feasibility: - This is concerned with the specifying equipment and the software
that successfully satisfies the user requirement. The technical need of the system very
considerably. In examining the technical feasibility the configuration of the system is
given importance than to the actual hardware. As the present system devoid of computer
assistant a complete revamping of the whole set-up will be required. Can the work for the
new system we done with current environment existing software technology & available
personnel. So we can say there are a number of technical issues. Which are generally
raised during the technical feasibility there are follows -?

 Does the necessary technology exist to do with what is suggested & can it required?
 Does the propose requirement have the technical capacity to hold the data required to use
the new system?
 Can the system we updated it developed?
 What new skill will be required to new technology do the existing staff members have
these skills if not can they we trained in due course of time?

2) Operational Feasibility: - It is mainly related to the human organizational and political


aspect. It involves the study of change to be brought about in the system, new skills
required etc. In the present system there is no use of computer. The operational staff is
having no idea about operation of the computer system. An introductory training of the
staff is needed.

3) Economic Feasibility: - It is the most frequently used technique for the evaluation of the
effectiveness of the proposed system. It involves the cost/benefit analysis. Economic
feasibility is the most frequently used method for evaluating the effectiveness system.
More commonly known is cost beneficial the procedure is to determine the benefits and
savings that are expected from a system and compare them with costs. If benefit is more
than the costs then the decision are made to design is made to design and implement the

Page - 7 -
system.

4) Social Feasibility: - It is the determination of whether a system will be accepted by the


user or not. This examines the probability of the project being accepted directed by the
user. While discussing with users it was observed that they are afraid of using a computer
system. This might be due to the fact they belong to diverse background. A computer
literacy program is very necessary before the installation and implementation of the
system failing which it may lead to rejection of the system.

5) Management Feasibility: - It determines whether the proposed system will be acceptable


to the management or not.

After studying and testing the above feasibilities we have found that our project stands firmly on
them.

OVERVIEW OF DOCUMENT:

PRIMARY GOAL OF DOCUMENT:

The primary goal of the document is to provide the entire information of the project. This includes
the need of the project, objectives of the project, and step-by-step implementation of SDLC (Software
Development Life Cycle). In case of our project the documentation describes the following details:

 Current System.
 Problem with current system
 Proposed system
 Modeling performed (Use cases analysis, sequence diagram, state chart diagram and
DFD)
 System Design(Class Diagrams)
 Testing Performed
 Future Enhancements

Page - 8 -
DOCUMENT CONVENTIONS:

Font : Times New Roman


Style
Heading : Bold, Underlined
Sub-heading : Bold, Underlined
Text : Normal
Font Size
Heading : 24
Sub-heading : 14
Text : 12
Alignment : Justified
Line Spacing : 1.5 lines

Page - 9 -
LITERATURE SURVEY

Page - 10 -
WHAT IS ATM?-

Automated Teller Machine (ATM), device used by bank customers to process account transactions.
Typically, a user inserts into the ATM a special plastic card that is encoded with information on a
magnetic strip. The strip contains an identification code that is transmitted to the bank's central
computer by modem. To prevent unauthorized transactions, a personal identification number (PIN)
must also be entered by the user using a keypad. The computer then permits the ATM to complete the
transaction; most machines can dispense cash, accept deposits, transfer funds, and provide
information on account balances. Banks have formed cooperative, nationwide networks so that a
customer of one bank can use an ATM of another for cash access.

WHAT IS SPEECH RECOGNITION?-

Speech recognition (also known as automatic speech recognition or computer speech recognition)
converts spoken words to machine-readable input (for example, to key presses, using the binary code
for a string of character codes). The term "voice recognition" is sometimes incorrectly used to refer to
speech recognition, when actually referring to speaker recognition, which attempts to identify the
person speaking, as opposed to what is being said. Confusingly, journalists and manufacturers of
devices that use speech recognition for control commonly use the term Voice Recognition when they
mean Speech Recognition.

Speech recognition is the process of converting an acoustic signal, captured by a microphone or a


telephone, to a set of words. The recognized words can be the final results, as for applications such as
commands & control, data entry, and document preparation.

Speech recognition applications include voice dialing (e.g., "Call home"), call routing (e.g., "I would
like to make a collect call"), domotic appliance control and content-based spoken audio search (e.g.,
find a podcast where particular words were spoken), simple data entry (e.g., entering a credit card
number), preparation of structured documents (e.g., a radiology report), speech-to-text processing
(e.g., word processors or emails), and in aircraft cockpits (usually termed Direct Voice Input).

Page - 11 -
An isolated-word speech recognition system requires that the speaker pause briefly between words,
whereas a continuous speech recognition system does not. Spontaneous, or extemporaneously
generated, speech contains disfluencies, and is much more difficult to recognize than speech read
from script. Some systems require speaker enrollment---a user must provide samples of his or her
speech before using them, whereas other systems are said to be speaker-independent, in that no
enrollment is necessary. Some of the other parameters depend on the specific task. Recognition is
generally more difficult when vocabularies are large or have many similar-sounding words. When
speech is produced in a sequence of words, language models or artificial grammars are used to
restrict the combination of words.

WHAT IS SIMULATION?-

Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating
something generally entails representing certain key characteristics or behaviours of a selected
physical or abstract system. A simulation is a representation of a situation with a similar but simpler
model that can easily be manipulated to determine experimental results. It is basically an experiment
run as a model of reality. Using a simulator or experimenting with a fictitious system can show the
eventual real effects of a given situation.

Examples:

Physical or manual simulations: These simulations rely on the use of physical methods to
create data that mimic the types of information required. Physical simulations are used in
many contexts, including the modeling of natural systems, and manual systems. Physical
methods, such as using a dice to simulate data have the disadvantage of being too time
consuming.

Computer simulations: Computer programs based on mathematical models are used to


manipulate elements of the experiment. This type of simulation can be applied in many ways.
In telegraphic engineering, computer simulations generate system topology and traffic models

Page - 12 -
that can be used for network performance management. Some computer exercises that use a
computer program to generate data or information are TELPACK, CSIM19, and Minitab.

Physical simulation refers to simulation in which physical objects are substituted for the real thing
(some circles use the term for computer simulations modelling selected laws of physics, but this
article doesn't). These physical objects are often chosen because they are smaller or cheaper than the
actual object or system.

A computer simulation (or "sim") is an attempt to model a real-life or hypothetical situation on a


computer so that it can be studied to see how the system works. By changing variables, predictions
may be made about the behaviour of the system.

In our project we are performing computer simulation and creating a computerized model.

WHAT IS ATM SIMULATOR?:

ATM-Simulator (ATM-SIM) is a computer-based trainer used for teaching individuals with


intellectual disabilities how to use an automated teller machine (ATM) to access their personal bank
accounts. In the pilot evaluation, a prototype system was developed and used to train nine adults with
intellectual disabilities how to use a local ATM. Participants were pre-tested on their ability to use an
ATM and then were trained using the ATM-SIM prototype. After a brief training period, participants
were again tested on their capacity to operate the actual ATM. Computer simulation of ATM can be
used effectively to teach a specific independent living skill to adults with mental retardation.

Simulation has been used effectively in many settings to teach skills that require both complex
problem solving abilities (e.g., nuclear power plant operators) as well as specific rote tasks (e.g.,
switchboard operators). Recently the increased availability, decreased cost, and emerging
technological advances associated with computers have made computer simulation a viable
alternative teaching method in a variety of settings. As a result, computer simulation has been used
increasingly as a cost-effective alternative to actual hands-on training. With technology, such as

Page - 13 -
ATMs, in which simulations may need to be used in training, it is likely that computers can provide
reasonably priced and realistic simulations that might provide for transfer of skills to community
settings.

ATM-SIM is designed as a multimedia training tool that provides individuals with intellectual
disabilities step-by-step instructions for learning how to use an ATM. Each step in the process, from
entering the ATM card, keying in an access code, selecting the desired transaction and completing
the transaction was simulated on the computer and presented to the user with step-by-step visual and
audio cues. Users interacted with the ATM-SIM system using a touch screen similar to actual
operation of an ATM. Each button and displayed message from a local ATM in the PLUS system of
ATMs was incorporated into the ATM-SIM system. Users were guided through each step of a desired
transaction via computer generated audio instructions and by visually highlighting the buttons that
needed to be pressed.

WHAT IS SPEECH CONTROLLED ATM SIMULATOR?:

Despite the success and widespread use of Automatic Teller Machines (ATMs), a significant
proportion of bank customers can not or will not use them, or experience difficulties in their
interactions. Speech technology has been suggested as a means by which non-users might be
encouraged to use ATMs, while simultaneously improving usability for all. The potential advantages
of speech interfaces include hands-free and eyes-free use for physically- and visually impaired users,
and improved ease and speed of use through increased 'naturalness' of the interaction. This study
investigated user attitudes to the concepts of a speech-based ATM, via large-scale survey and a series
of focus groups. Objective performance was also considered in user trials with a prototype speech-
driven ATM. The idea of using speech for ATM transactions led to a number of concerns. Privacy
(the concern over one's personal financial details being overheard) and security (the fear of potential
attackers hearing the user withdraw cash) were the major reasons given. The user trials confirmed
that possible solutions, such as the adoption of a hood over the ATM or the use of a telephone
handset as the speech input/output device, were ineffective. Groups of impaired users, particularly
visually-impaired subjects, were more positive about the concept of speech, citing various difficulties

Page - 14 -
with current visual-manual interactions. Most non-users, however, would not be encouraged to use
ATMs with the addition of speech.

As per literature survey we have learned what an ATM is, what a simulation is and why we simulate
any real world system. So before we move further we must consider the following aspects regarding
ATM Simulator. The aspects are as follows-

 Security: The security is the main concern in case of ATM machines. So this point must also
be considered in ATM Simulator. So secured handling of PIN (Personal Identification
Number) and secured manipulation of other information across the network must also take
place.
 Functionality: The ATM Simulator must include all the possible basic and advanced features
that can be provided by a modern ATM machine.
 Usability: Unlike the modern ATM machines the simulator should be useful to a wide range
of users and the users must use it without any assistance. The simulator must be user friendly
and must support multiple languages.
 Efficiency: The simulator must be fast and easy in operation.
 Service Extension: The simulator must be helpful to extend the functionalities of the real
world ATM machines. It means that the banks can experiment the enhancements on the
simulator before they implement it in the real world system.

Page - 15 -
TECHNOLOGY SURVEY

Page - 16 -
JAVA is the language used and in it following packages are used:
 java.sql
 java.awt
 java.awt.event
 javax.swing
 java.awt.print
 javax.print.attribute
 java.sound.sampled
 java.util
 java.text
 java.io
 javax.speech
 javax.speech.synthesis
 javax.speech.recognition
 javax.swing.filechooser
 java.rmi
 RmiJdbc

Java is a high-level programming language that is all of the following:

 Simple
 Object-oriented
 Portable
 Distributed
 High performance
 Interpreter
 Multithreaded
 Robust
 Dynamic
 Secure

Page - 17 -
Java program is both compiled and interpreted. With a compiler, you translate a Java program into an
intermediate language called Java byte codes- the platform-independent codes interpreted by the Java
interpreter. With an interpreter, each Java byte code instruction is parsed and run on the computer.
Compilation happens just once; interpretation occurs each time the program is executed. This figure
illustrates how this works.

Fig: Execution of Java Program

Page - 18 -
Fig: Java program executions

One can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java
VM). Every Java interpreter, whether it's a Java development tool or a Web browser that can run Java
applets, is an implementation of the Java VM. The Java VM can also be implemented in hardware.

Java byte codes help make "write once, run anywhere" possible. You can compile your Java program
into byte codes on any platform that has a Java compiler. The byte codes can then be run on any
implementation of the Java VM. For example, the same Java program can run on Windows NT,
Solaris, and Macintosh.

java.sql

This package is used for avail of classes and drivers required for accessing and manipulating
databases through Java programs. The technology is termed as JDBC (Java Data Base Connectivity).
JDBC is a set of API which in use to wrap up SQL queries and then sends them to the target
database. Connecting a Java application in back end requires the use of JDBC. Following are the
steps mainly used when a Java program connects itself to a backed:-
1. Import the package java.sql.
2. Load and register the driver.
3. Establish connection to the database.

Page - 19 -
4. Create a statement.
5. Execute the SQL query and obtain the results.
6. Retrieve the values of the columns of each row.
7. Terminate the connection.

Method used:
1. Class.forName(String ) throws ClassNotFoundException : This method notifies and use
the driver required for accessing the database.Overall there are 127 drivers available. By
default Java use the following driver –“sun.jdbc.odbc.JdbcOdbcDriver”.

2. public Connection getConnection(String) throws SQLException: This method is a ststic


member of DriverManager class and is used to connect the driver to the database.

3. public Stsatement createStatement() throws SQLException: A „statement‟ is an interface


and by creating its objects we get a workspace to fire SQL queries and retrieve any
results. Statement objects are created by the above method belonging to the „Connection‟
interface.

4. public Resultset executeQuery(String) throws SQLException: Once we have created a


„statement‟ object our next job is to execute an SQL query by calling the above method
which belongs to a „Statement‟ class. And it is used for executing „select‟ query.

5. public int executeUpdate(String) throws SQLException: This method is used for


executing the „insert,‟update‟ and „delete‟ queries.

6. public boolean next() throws SQLException: This method belongs to the „ResultSet‟ class
and is used to move the cursor to the next record in the resultset. The first record is at row
1.

Page - 20 -
7. public Xxx getXxx(String ) throws SQLException: This method belongs to the
„ResultSet‟ class. Here Xxx may be replaced by the data types present in Java. This
method is used to retrieve the data from the resultset. The parameter takes the name of the
column whose data is to fetched from the resultset.

8. public void close() throws SQLException: This method is present in


„ResultSet‟,‟Statement‟ and „Connection‟ class to close the respective connections.

For example:
import java.sql.*;

class Database
{
public static void main(String [] args)
{
Connection con ;
try
{
Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
con = DriverManager.getConnection(“college”);
Statement st = con.createStatement();
St.executeUpdate(“INSERT INTO Details VALUES(„Ajay‟,10));
ResultSet r=st.executeQuery(“Select * from Details”) ;
While(r.next())
{
System.out.println(“Name =”+r.getString(“Name”)+ “ Roll No=”+r.getInt(2));
}
}
catch(ClassNotFoundException e)
{

Page - 21 -
System.out.println(“Cannot File the class”);

}
catch(SQLException f)
{
System.out.println(f.getMessage());
}
finally
{
con.close();
}
}
}

javax.sound.sampled

This package is used to play the recorded sampled sound. Samples are successive snapshots of a
signal. The signal is a sound wave in the case of audio. Plying sound sometimes is referred to as
presentation or rendering. For playing sound there are two kinds of line. A Clip and a
SourceDataLine. Clip specifies all data line at a time for playback whereas SourceDataLine allows
one to keep writing in the buffer while playback. The permitted formats of audio file for sampled
playback are .wav,.auf,.av.

Method Used:
1. public AudioSystem getAudioInputStream(File): This method returns the object of
AudioInputStream class and takes the name of the audio file as an object of File class.This
method is a static method of AudioSyatem class.

2. public DataLine.Info (Clip,AudioInputStream): This is a constructor.

Page - 22 -
3. public (Clip) getLine(AudioInputSteream) : This method belongs to the AudioSystem
class and creates a line of the audiofile.

4. public void open(AudioInputSteam): This method belongs to Clip class and is used to
open the audio file for playback.

5. public void start(): This method plays the file and is not stopped until the file is
completed.

6. public void stop(): This method stops the current playing file.

7. public void setMicrosecondPosition(long): This method is used to set the position of head
at the position passed as argument.

For Example:
import javax.sound.sampled.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class Playing_Sound
{
private AudioInputStream ain;
private DataLine.Info info;
private File f;
private Clip clip;

Page - 23 -
public Playing_Sound(String name)
{
try
{
f=new File(name);
ain=AudioSystem.getAudioInputStream(f);
info=new DataLine.Info(Clip.class,ain.getFormat());
clip=(Clip) AudioSystem.getLine(info);
clip.open(ain);
System.out.println(ain.getFormat());

}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}

public void play()


{ try
{
clip.start();

System.out.println(clip.getMicrosecondPosition());
}
catch(Exception r) {}
}

public void stop()

Page - 24 -
{
clip.stop();
}

public void resume()


{
clip.setMicrosecondPosition(0);
}

class Player extends JFrame implements ActionListener


{
JPanel p;
JButton b,s;

Player(String name)
{
super(name);
p=new JPanel();
b=new JButton("Play");
s=new JButton("Stop");
b.addActionListener(this);
s.addActionListener(this);
p.add(b);
p.add(s);
add(p);
setBounds(0,0,100,200);
p.setVisible(true);
setVisible(true);
}

Page - 25 -
public void actionPerformed(ActionEvent e)
{
Playing_Sound p=new Playing_Sound("C:\\gh.wav");

if(e.getSource()==b)
{
p.play();
}
else if(e.getSource()==s)
{
p.stop();

}
}
}
class Player_Test
{
public static void main(String [] args)
{
Player o=new Player("My First Player");
}
}

javax.speech & javax.speech.synthesis & javax.speech.recognition

In JAVA speech synthesis is supported by javax.speech.synthesis package. A speech


synthesizer is a speech engine that converts text to speech. The javax.speech.synthesis package
defines the Synthesizer interface to support speech synthesis plus a set of supporting classes and
interfaces. As a type of speech engine, much of the functionality of a Synthesizer is inherited from
the Engine interface in the javax.speech package and from other classes and interfaces in that
package.

Page - 26 -
The following code shows a simple use of speech synthesis to speak the string "Hello World".

import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;

public class HelloWorld {


public static void main(String args[]) {
try {
// Create a synthesizer for English
Synthesizer synth = Central.createSynthesizer(
new SynthesizerModeDesc(Locale.ENGLISH));

// Get it ready to speak


synth.allocate();
synth.resume();

// Speak the "Hello world" string


synth.speakPlainText("Hello, world!", null);

// Wait till speaking is done


synth.waitEngineState(Synthesizer.QUEUE_EMPTY);

// Clean up
synth.deallocate();
} catch (Exception e) {
e.printStackTrace();
}
}
}

This example illustrates the four basic steps which all speech synthesis applications must perform.
Let's examine each step in detail.

Create: The Central class of javax.speech package is used to obtain a speech


synthesizer by calling the createSynthesizer method. The SynthesizerModeDesc
argument provides the information needed to locate an appropriate synthesizer. In this
example a synthesizer that speaks English is requested.

Allocate and Resume: The allocate and resume methods prepare the Synthesizer
to produce speech by allocating all required resources and putting it in the RESUMED
state.

Page - 27 -
Generate: The speakPlainText method requests the generation of synthesized
speech from a string.

Deallocate: The waitEngineState method blocks the caller until the Synthesizer
is in the QUEUE_EMPTY state - until it has finished speaking the text. The deallocate
method frees the synthesizer's resources.

In JAVA speech recognition is supported by javax.speech.recognition package. A speech


recognizer is a speech engine that converts speech to text. The javax.speech.recognition package
defines the Recognizer interface to support speech recognition plus a set of supporting classes and
interfaces. As a type of speech engine, much of the functionality of a Recognizer is inherited from
the Engine interface in the javax.speech package and from other classes and interfaces in that
package.

The following example shows a simple application that uses speech recognition. For this application
we need to define a grammar of everything the user can say, and we need to write the Java software
that performs the recognition task.

A grammar is provided by an application to a speech recognizer to define the words that a user can
say, and the patterns in which those words can be spoken. In this example, we define a grammar that
allows a user to say "Hello World" or a variant. The grammar is defined using the Java Speech
Grammar Format.

Place this grammar into a file.

#JSGF V1.0;
grammar <grammar_name>;
public <sentence> = hello world | good morning |
hello mighty computer;

This trivial grammar has a single public rule called "sentence". A rule defines what may be spoken
by a user. A public rule is one that may be activated for recognition.

The following code shows how to create a recognizer, load the grammar, and then wait for the user to

Page - 28 -
say something that matches the grammar. When it gets a match, it deallocates the engine and exits.

import javax.speech.*;
import javax.speech.recognition.*;
import java.io.FileReader;
import java.util.Locale;

public class HelloWorld extends ResultAdapter {


static Recognizer rec;

// Receives RESULT_ACCEPTED event: print it, clean up, exit


public void resultAccepted(ResultEvent e) {
Result r = (Result)(e.getSource());
ResultToken tokens[] = r.getBestTokens();

for (int i = 0; i < tokens.length; i++)


System.out.print(tokens[i].getSpokenText() + " ");
System.out.println();

// Deallocate the recognizer and exit


rec.deallocate();
System.exit(0);
}

public static void main(String args[]) {


try {
// Create a recognizer that supports English.
rec = Central.createRecognizer(new

Page - 29 -
EngineModeDesc(Locale.ENGLISH));

// Start up the recognizer


rec.allocate();

// Load the grammar from a file, and enable it


FileReader reader = new FileReader(args[0]);
RuleGrammar gram = rec.loadJSGF(reader);
gram.setEnabled(true);

// Add the listener to get results


rec.addResultListener(new HelloWorld());

// Commit the grammar


rec.commitChanges();

// Request focus and start listening


rec.requestFocus();
rec.resume();
} catch (Exception e) {
e.printStackTrace();
}
}
}

This example illustrates the basic steps which all speech recognition applications must perform. Let's
examine each step in detail.

Page - 30 -
Create: The Central class of javax.speech package is used to obtain a speech recognizer
by calling the createRecognizer method. The EngineModeDesc argument provides the
information needed to locate an appropriate recognizer. In this example we requested a
recognizer that understands English (since the grammar is written for English).

Allocate: The allocate methods requests that the Recognizer allocate all necessary
resources.

Load and enable grammars: The loadJSGF method reads in a JSGF document from a reader
created for the file that contains the javax.speech.demo grammar. (Alternatively, the
loadJSGF method can load a grammar from a URL.) Next, the grammar is enabled. Once the

recognizer receives focus, an enabled grammar is activated for recognition: that is, the
recognizer compares incoming audio to the active grammars and listens for speech that
matches those grammars.

Attach a ResultListener: The HelloWorld class extends the ResultAdapter class which is a
trivial implementation of the ResultListener interface. An instance of the HelloWorld class
is attached to the Recognizer to receive result events. These events indicate progress as the
recognition of speech takes place. In this implementation, we process the RESULT_ACCEPTED
event, which is provided when the recognizer completes recognition of input speech that
matches an active grammar.

Commit changes: Any changes in grammars and the grammar enabled status needed to be
committed to take effect (that includes creation of a new grammar).

Request focus and resume: For recognition of the grammar to occur, the recognizer must be in
the RESUMED state and must have the speech focus. The requestFocus and resume methods
achieve this.

Process result: Once the main method is completed, the application waits until the user
speaks. When the user speaks something that matches the loaded grammar, the recognizer

Page - 31 -
issues a RESULT_ACCEPTED event to the listener we attached to the recognizer. The source of
this event is a Result object that contains information about what the recognizer heard. The
getBestTokens method returns an array of ResultTokens, each of which represents a single

spoken word. These words are printed.

Deallocate: Before exiting we call deallocate to free up the recognizer's resources.

javax.swing.filechooser

This package is used to hide the system warnings regarding the hard disks used. In our project we are
using floppy drive as or card, so if the floppy drive is not inserted then the system warning will be
flashed. So to hide the message and to make the system to continuously sense the floppy drive we
have to use the above class.
Method Used:
1. public FileSystemView getFileSystemView(): This method is used to find all the
permanent drives present in the system. It is a static method of FileSystemView class and
returns the same class object.
2. public File listRoots(): This method is used to provide an array of File of the drives.
3. public boolean exists(): This method determines whether the disk is present at the
appropriate drive or not.

For Example:
FileSystemView fsv = FileSystemView.getFileSystemView();
File[] f = File.listRoots();
do
{
}while(!f[1].exists());

Page - 32 -
java.util & java.text:

Although there are various classes and methods available in these packages for various jobs but we
have used these packages to extract current date and time.

Method Used:

1. public DateFormat getDateInstance(int,Locale): This method returns the current date and
time of the local system depending upon the Locale and format passed.
2. public String format(Date): This method returns the DateFormat object in a string form
for editing.

3. java.util.Date(): This is a non-parameterized constructor of Date class to construct it‟s


object.
For Example:

class DateTime
{ static:
{
private DateFormat cv=DateFormat.getDateInstance(DateFormat.MEDIUM,new
Locale("en"));
private DateFormat tz=DateFormat.getTimeInstance(DateFormat.SHORT,new
Locale("en"));
private java.util.Date now = new java.util.Date();
private String currentdate,currenttime,at;
currenttime = tz.format(now);
at=cv.format(now);
System.out.println(“Date=”+currentdate);
System.out.println(“Time=”+currenttime);
}
}

Page - 33 -
class Test
{
public static void main(String [] p)
{
DateTime h=new DateTime();
}
}

java.awt & java.awt.event. & javax.swing

These three packages are solely used for implementing the front end of our program. The package
javax.swing has been used for designing the components in our code. And the remaining two
packages has been used for handling, registering and listening the events fired while clicking an
button.

Class JButton

Inheritance hierarchy of Class JButton


java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton

Constructor used:
JButton(String text)
Creates a button with text.

Page - 34 -
Methods used:
1. boolean isEnabled():Returns true if button is enabled else returns false

2. void setEnabled(Boolean):Enables or disables a button

3. void setFont(Font):Sets a specified font for the button

4. void setBounds(int x, int y, int width, int height):Moves and resizes this component. The
new location of the top-left corneris specified by x and y, and the new size is specified
by width and height.

5. void addActionListener(ActionListener): Adds the specified action listener to

receive action events from this button

Event used:
Public void actionPerformed(ActionEvent)
The event is fired whenever a button is clicked.

Class TextField

java.lang.Object
java.awt.Component
java.awt.TextComponent
java.awt.TextField

Constructor used:
TextField(int columns)
Constructs a new empty text field with the specified number of columns

Methods used:
1. void setEchoChar(char c):Sets the echo character for this text field

Page - 35 -
2. void setFont(Font):Sets a specified font for text field

3. void setBounds(int x, int y, int width, int height):Moves and resizes this component. The new
location of the top-left corner is specified by x and y, and the new size is specified by width
and height.

4. void requestFocus():Brings the cursor to the text field

5. void setText(String):Sets the text that is presented by this text component to be the specified
text

6. String getText():Returns the text that is presented by this text component

7. void addTextListener(TextListener): Adds the specified Text listener to receive text

events from this text field

Event used:
public void textValueChanged(TextEvent)
The event is fired whenever text of a text field is changed.

Class JLabel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel

Page - 36 -
Constructor used:
JLabel(String text)
Creates a JLabel instance with the specified text

Methods used:
1. void setFont(Font):Sets a specified font for the Label

2. void setBounds(int x, int y, int width, int height):Moves and resizes this component. The new
location of the top-left corner is specified by x and y, and the new size is specified by width
and height.

3. void setText(String):Sets the text that is presented by this text component to be the specified
text

Class JPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel

Constructor used:
JPanel()
Create a new JPanel with a double buffer and a flow layout

Methods used:
1. void setBackground(Color):Sets the background color of this Panel

Page - 37 -
2. Boolean isVisible():Returns true if Panel is visible

3. void setVisible(Boolean):Sets the panel visible or invisible

4. Component add(Component comp):Adds the specified component to the panel

Class JFrame

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame

Constructor used:
JFrame(String title)

Creates a new, initially invisible Frame with the specified title

Methods used:
1. void setBounds(int x, int y, int width, int height):Moves and resizes this component. The new
location of the top-left corner is specified by x and y, and the new size is specified by width
and height.

2. void setVisible(Boolean):Sets the frame visible or invisible

3. void setDefaultCloseOperation(int operation):Sets the operation that will happen by

default when the user initiates a "close" on this frame

Page - 38 -
For Example:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

class Myjframe extends JFrame implements ActionListener,TextListener


{
JPanel jp1,jp2;
JButton jb1,jb2;

JLabel lb1,lb2;
TextField jt;
Myjframe(String str)
{
super(str);
jp1=new JPanel();
jp2=new JPanel();
jb1=new JButton("NEXT");
jb2=new JButton("BACK");
lb1=new JLabel("");
lb2=new JLabel("");
jt=new TextField(20);
jb1.addActionListener(this);
jb2.addActionListener(this);
jp1.add(lb1);
jp1.add(jb1);
jp1.add(jt);
jp2.add(lb2);
jp2.add(jb2);
jp1.setBackground(Color.red);

Page - 39 -
jp2.setBackground(Color.green);
setBounds(0,0,500,500);
add(jp1);
add(jp2);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

public void actionPerformed(ActionEvent e)


{
if(e.getSource()==jb1)
{
jp1.setVisible(false);
jp2.setVisible(true);
add(jp2);
}
else
{
jp2.setVisible(false);
jp1.setVisible(true);
add(jp1);
}
}
public void textValueChanged(TextEvent t)
{
lb1.setText(jt.getText());
lb2.setText(jt.getText());
}

Page - 40 -
}

class Test
{
public static void main(String [] args)
{
Myjframe mj=new Myjframe("My swing application");
}}

Layouting: Lay outing can be done in the two ways either by using LayoutManager or without it.

Layouting by using Layout manager: A layout manager is an object that implements the
LayoutManager interface and determines the size and position of the components within a container.

Although components can provide size and alignment hints, a container's layout manager has the
final say on the size and position of the components within the container.

Several AWT and Swing classes provide layout managers for general use:

BorderLayout
BoxLayout
CardLayout
FlowLayout
GridBagLayout
GridLayout
GroupLayout

BorderLayout: Every content pane is initialized to use a BorderLayout. A BorderLayout places

components in up to five areas: top, bottom, left, right, and center. All extra space is placed in the
center area. Tool bars that are created using JToolBar must be created within a BorderLayout
container, if we want to be able to drag and drop the bars away from their starting positions.

Page - 41 -
BoxLayout: The BoxLayout class puts components in a single row or column. It respects the
components' requested maximum sizes and also lets we align components.

CardLayout: The CardLayout class lets us implement an area that contains different
components at different times. A CardLayout is often controlled by a combo box, with the state
of the combo box determining which panel (group of components) the CardLayout displays.

FlowLayout: FlowLayout is the default layout manager for every JPanel. It simply lays out
components in a single row, starting a new row if its container is not sufficiently wide.

GridBagLayout: GridBagLayout is a sophisticated, flexible layout manager. It aligns


components by placing them within a grid of cells, allowing components to span more than one
cell. The rows in the grid can have different heights, and grid columns can have different widths.

GroupLayout: GroupLayout is a layout manager that was developed for use by GUI builder
tools, but it can also be used manually. GroupLayout works with the horizontal and vertical
layouts separately. The layout is defined for each dimension independently. Consequently,
however, each component needs to be defined twice in the layout. The Find window shown above
is an example of a GroupLayout.

Doing Without a Layout Manager (Absolute Positioning):

Although it is possible to do without a layout manager, you should use a layout manager if at all
possible. A layout manager makes it easier to adjust to look-and-feel-dependent component
appearances, to different font sizes, to a container's changing size, and to different locales. Layout
managers also can be reused easily by other containers, as well as other programs.

If a container holds components whose size is not affected by the container's size or by font, look-
and-feel, or language changes, then absolute positioning might make sense. Desktop panes, which
contain internal frames are in this category. The size and position of internal frames does not
depend directly on the desktop pane's size. The programmer determines the initial size and
placement of internal frames within the desktop pane, and then the user can move or resize the

Page - 42 -
frames. A layout manager is unnecessary in this situation

Another situation in which absolute positioning might make sense is that of a custom container
that performs size and position calculations that are particular to the container, and perhaps
require knowledge of the container's specialized state.

Creating a container without a layout manager involves the following steps.

1) Set the container's layout manager to null by calling setLayout(null).


2) Call the Component class's setbounds method for each of the container's children.
3) Call the Component class's repaint method.

However, creating containers with absolutely positioned containers can cause problems if the
window containing the container is resized.

For Example:
pane.setLayout(null); //pane is a JPanel object
JButton b1 = new JButton("one");
JButton b2 = new JButton("two");
JButton b3 = new JButton("three");

pane.add(b1);
pane.add(b2);
pane.add(b3);

Insets insets = pane.getInsets();


Dimension size = b1.getPreferredSize();
b1.setBounds(25 + insets.left, 5 + insets.top,
size.width, size.height);
size = b2.getPreferredSize();
b2.setBounds(55 + insets.left, 40 + insets.top,
size.width, size.height);
size = b3.getPreferredSize();

Page - 43 -
b3.setBounds(150 + insets.left, 15 + insets.top,
size.width + 50, size.height + 20);

...//In the main method:


Insets insets = frame.getInsets();
frame.setSize(300 + insets.left + insets.right,
125 + insets.top + insets.bottom);

In our project we use Layouting without using LayoutManager

Page - 44 -
PRODUCT SPECIFICATION

Page - 45 -
PRODUCT PERSPECTIVES:

The real world ATM is continuously developing day by day. More and more new and exciting
features are incorporated in the machine as per customer‟s increasing needs. In the earlier times ATM
was only recognized for cash withdrawal or balance enquiry. But now a day various new features like
cash deposits, various Bill payments, Mobile recharge etc are added which are attracting more and
more customers. In spite of these advancements in the ATM world, the ATM is not successful in
rural areas. Most of the people are illiterate and even can‟t perform a simple transaction like cash
withdrawal due to language bondation. The same problem exists with the blind people. Providing
more and more language options is useless because they may not be able to read a text written on the
screen. Thus the existing system although growing day by day and fulfilling more and more needs of
customers fails in the case when simplicity and user friendliness is measured.

The proposed system “Speech controlled ATM” provides all the basic as well as advanced features of
a standard real world ATM system. Along with it to add more simplicity and to make the machine
more user friendly concepts like speech synthesis and speech recognition are added.

PRODUCT SCOPE:

The scope of the project are as follows:


As the project is a simulator so the new experiments can be performed on it before we implement
it on the real world machine. So here we are also performing an experiment of speech synthesis
and speech recognition. The performance of the system can be studied on the simulator and then
it can be implemented on real world machines. Similarly, we can also perform other
advancements on the simulator before deploying it on the real system.

Page - 46 -
PRODUCT FUNCTIONS:

The software to be designed will control a simulated Automated Teller Machine (ATM) having a
capablility to read a card, a customer console (keyboard and display) for interaction with the customer
and a printer for printing customer receipts. The simulator must work in a networked environment
(i.e... LAN in our case).It must also communicate with the requisite servers available in LAN. The
simulator software includes also the basic featur es of an ATM viz... Withdrawal, deposit, transaction
details, money transfer and balance queries.

Along with the above features the simulator also demonstrates the additional features like payment of
telephone and electricity bills and other services. The project also helps us to understand the Software
Engineering principles and Object Oriented Programming principles in a better way.

In our project we have pointed out a new idea regarding user friendliness by introducing the concepts
of speech synthesis and speech recognition.

USER CLASSES & CHARECTERISTICS:

The user can be both rural and urban people and possess the following characteristics:

 Rural people are in general illiterate and would like to use the ATM through speech for
simplicity.
 Whereas the urban people are literate and can use speech as well as manual techniques.
 Rural people want the basic banking features.
 Urban people require both banking features and supplementary services.

Page - 47 -
OPERATING ENVIRONMENT:

As we know that the real world ATM machines work in a WAN (Wireless Area network). So it
becomes necessary for our project to work at least in a networked environment. So for this we have
implemented our project in a distributed environment which consists of a server end and multiple
client ends. The software runs on the client end and the request made by the user at the client end
goes for validation at the server end and if it has been validated then the requested transaction is
performed at the server and the appropriate message is displayed at the server.

Although the web based environment can also be used in place of distributed environment, but then
browser was needed to run the program which doesn‟t give a good look and feel, so in order to run
the application with good look and feel we have used distributed environment as our operating
environment.

USER ENVIRONMENT:

As discussed above the software will run in a distributed environment having multiple client ends and
a single server end. So the user will operate on the client end of the distributed environment from
where he will make request and that will be executed on the server end. And the server will respond
the user at client end appropriately.

ASSUMPTIONS AND DEPENDIES:

Simulation is the process of constructing a computerized model of a real world system. And to
construct this system certain assumptions are taken. So do as our project has certain assumptions
which are as follows:

Page - 48 -
 Real world ATM machines work in WAN whereas our simulator works in LAN (i.e.
distributed environment).
 Unlike real world ATM machines there is no cash dispensing.

 For deployment of the software all the client and server ends system must have compatible
JDK versions (i.e. JDK 1.4 onwards).
 Instead of touch screens in real world ATM machines our software uses mouse for selection
of options.

Page - 49 -
REQUIREMENT AND SYSTEM ANALYSIS

Page - 50 -
EXTERNAL INTERFACE REQUIREMENTS:

USER INTERFACES:

The user interfaces can be well defined by the following diagrams:

Enters card ATM SIMULATOR


SCREEN

Prompt to select language


LANGUAGE
SCREEN

Select language
through speech

LANGUAGE
SCREEN

Page - 51 -
Prompt to perform transaction TRANASACTION
SCREEN

Selection through speech

Select a transaction
TRANSACTION
SCREEN

After performing the transaction the


MESSAGE
appropriate message is displayed SCREEN
in a printed from.

HARDWARE INREFACES:

Hardware interfaces defines how hardware will be used by the user in the product. As there is no
hardware utility in our project so there is anything such as hardware interfaces.

COMMUNICATION PROTOCOLS:

As defined above the software will work in distributed environment. And in Java distributed
environment can be deployed by three techniques, which are as follows:

 RMI(Remote Method Invocation) 


 CORBA(Common Object Request Broker)
 SOAP(Simple Object Access Protocol) 

Page - 52 -
Among the above three techniques we have used RMI(Remote Method Invocation) which permits
communication between two Java objects, whereas the remaining two permits communication
between Java object and other language object.

If we have to access the remote computer then we have to call the remote method of the remote
object. The object that calls the remote object is called „client object‟. And, the remote object I
known as „server object‟. The system on which the client object runs is known as client and the other
is known as server. So, the communication protocol used in our project can be defined by the
following figure.

CLIENT SERVER
CLIENT STUB STUB SERVER

Call Stub on local

Proxy object Send marshaled parameters

Call server method

Return result

Marshaled return values

Response values

Whenever the client code makes a call to the method of a remote object then the call is made to an
ordinary method in the local proxy called stub. The stub packages the parameters to be passed in the
remote method and performs machine independent coding. The process of encoding of parameter is
called parameter marshaling. Parameter marshaling is done to convert the parameters into a
transmission format. When the receiver at the server side receives the format it un-marshals it and
execute the method at server. The result to be returned is marshaled and transmitted to stub of client
side, where it is un-marshaled and displayed to the client.

Page - 53 -
INFRASTRUCTURE REQUIREMENTS:

HARDWARE REQUIREMENTS:

SERVER SITE:
 Processor : Pentium 3 onwards
 Hard Disk : 10 GB
 RAM : 512 MB

CLIENT SITE:
 Processor : Pentium II onwards
 Hard Disk : 5 GB
 RAM : 256 MB
 Good quality headphone and microphone
 Floppy Drive Reader
 Printer

SOFTWARE REQUIREMENTS:

SERVER SITE:
 Operating System : Any Network Operating System (e.g. Windows server 2003)
 Front End : Java (JDK 1.4 onwards)
 Back End : MS-Access

CLIENT SITE:
 Operating System : Compatible Operating System with NOS (e.g. Widows Xp)
 Front End : Java (JDK 1.4 onwards)

Page - 54 -
FUNCTIONAL REQUIREMENTS:

Following are the general functional requirements of our project:

1) Entry: The model will service one customer at a time. A customer will be required to
insert a card and enter a personal identification number (PIN) - both of which will be sent
to the bank server for validation as part of each transaction. As soon as the user entry has
been authenticated then a session will be initialized for him/her which will end either
when the user finishes transactions or he/she aborts the session.

2) PIN (Personal Identification Number) Access: If the ATM Simulator determines that the
customer's PIN is invalid, the customer will be required to re-enter the PIN before a
transaction can proceed. If the customer is unable to successfully enter the PIN after three
tries, the card will be locked by the machine, and the customer will have to contact the
bank to unlock it.

3) Transactions: The customer will be able to perform one or more transactions. The ATM
Simulator will communicate each transaction to the bank and obtain verification that it
was allowed by the bank. Ordinarily, a transaction will be considered complete by the
bank once it has been approved. If a transaction fails for any reason other than an invalid
PIN, the ATM will display an explanation of the problem, and will then ask the customer
whether he/she wants to do another transaction. A customer must be able to abort a
transaction in progress anytime instead of responding to a request from the machine.

Withdrawal: This feature allows the card user for withdrawing


money.
Balance Enquiry: This helps the card user to obtain either a printed
or non-printed balance status.

Transaction Details: These features help the card user to obtain last

Page - 55 -
ten transactions details of the account in a printed way.
Money Transfer: This helps the card user to transfer the money
from his account to another account in the same branch or same
bank.
Deposit: This feature allows the card user to deposit the money in
his/her account.

4) Services: This includes the additional services which can be performed


through an ATM Simulator. The services present in the simulator are as
follows –
Bill Payment: This includes the facility of payment of electricity
bill and telephone bill through your ATM. The telephone bill can
be paid only to those providers who have coordination with the
bank
.
5) Acknowledgements: The ATM Simulator will provide the customer with a printed receipt
for each successful transaction, showing the date, time, machine location, type of
transaction, account(s), amount, and ending and available balance(s) of the affected
account. It also provides the printed balance transaction details and an error message if
any error is encountered.

6) Speech Recognition & Synthesis: The ATM system will now help the user by guiding
him throughout the transaction by giving speech in his or her mother language. This is
known as speech synthesis. And, the ATM system will now be able to recognize spoken
commands. The customer can now give voice commands in his mother language with
the help of a microphone and the ATM machine recognizes those spoken commands and
takes the appropriate action. This is known as Speech recognition.

Page - 56 -
DOMAIN ANALYSIS

USE CASES ANALYSIS:

Use-case: Card Entry-PIN entry


Actor: User
 The user enters the card.
 The system checks whether the card is properly inserted or not.
 If, properly inserted then system prompts the user to enter PIN.
 User enters PIN.
 System validates the PIN.
 If valid then display the transactions that user can perform.
 If the PIN is invalid then the user can re-enter the PIN at a maximum of three times.
 If the user enters the PIN wrong at fourth time then the system will block user‟s account.

Use-case: Performing Transaction


Actor: User
 System displays the available transactions that user can perform.
 User selects one of the transactions either through speech or manually.
 System prompts the user to enter the relative data for performing the selected transaction.
 User enters the data.
 System performs the transaction.
 System provides a printed acknowledgement depending upon the transaction.

Use-case: Withdraw
Actor: User
 User selects „withdraw‟ either through speech or manually.
 System prompts user to enter the amount.

Page - 57 -
 User enters the amount.
 System performs & commits the transaction.
 System acknowledges user with an updated printed balance details of account.

Use-case: Deposit
Actor: User
 User selects „deposit‟ either through speech or manually.
 System prompts user to enter the amount.
 User enters the amount.
 System prompts the user to enter the denominations
 System checks the denominations.
 System performs & commits the transaction.
 System acknowledges user with an updated printed balance details of account

Use-case: Balance Enquiry


Actor: User
 User selects „balance enquiry‟ either through speech or manually.
 System prompts user whether user wants printed advice or not.
 User selects his choice.
 System displays the current balance as per the selected choice.

Use-case: Money Transfer


Actor: User
 User selects „transfer‟ either through speech or manually.
 System prompts user to enter the target account number.
 System checks the target account number for validation
 System prompts the user to enter the amount to be transferred.
 User enters the amount.
 System performs & commits the transaction.
 System acknowledges user with an updated printed balance details of account

Page - 58 -
Use-case: Mini Statement
Actor: User
 User selects „mini statement‟ either through speech or manually.
 System displays the last 10 transactions performed on his account in a printed form.

Use-case: Telephone Bill Payment


Actor: User
 User selects „Telephone Bill‟ either through speech or manually.
 System prompts user to enter the consumer number.
 System checks the consumer number for validation
 System displays the last bill details for the consumer number.
 System prompts the user for payment.
 User selects for payment.
 System performs & commits the transaction.
 System acknowledges user with an updated printed balance details of account & bill details.

Use-case: Electricity Bill Payment


Actor: User
 User selects „Electricity Bill‟ either through speech or manually.
 System prompts user to enter the consumer number.
 System checks the consumer number for validation
 System displays the last bill details for the consumer number.
 System prompts the user for payment.
 User selects for payment.
 System performs & commits the transaction.
 System acknowledges user with an updated printed balance details of account & bill details.

Page - 59 -
STATE CHART DIAGRAM:

Tries<=3

Card
CARD READER invalid
Do: Check Card INTERFACE
Valid PIN entered
Do: Prompt for PIN
Tries>3

LOCKED

Do: Block Account PIN VALIDATOR


Successful activation
Do: Validate PIN

valid

PRINT INTERFACE INTERFACE

Do: Display & Print Acknowledgement Do: Display &Prompt for transaction

Prompt for transaction selection

TRANSACTION

Do: Perform selected transaction

Acknowledgement message

ACTIVITY DIAGRAMS:

An activity diagram comes under “Scenario based modeling” of analysis modeling. The UML
activity diagram supplements the use-case by providing a graphical representation of the flow of
interaction within a specific scenario. An activity diagram uses rounded rectangles to imply a specific
system function, arrows to represent flow through the system, decision diamonds to depict a
branching decision and solid horizontal lines to indicate that parallel activities are occurring.

Page - 60 -
Enter card

Not properly inserted


Properly inserted

Select language Prompt for re-entry of card

Enter PIN

Invalid PIN Valid PIN

No. of tries<=3
No. of tries>3

Select a transaction

Perform selected transaction Update databases

Acknowledgement/error message

Page - 61 -
SYSTEM DESIGN:

INTRODUCTION:

System Design is generally a collection of principles, concepts and practices that lead to the
development of a high quality system that lead to the development of a high quality product. The
main goal of design engineering is to define a model or representation that can be used to fulfill the
customer about the satisfactory of the constructed software.

In context of a software engineering it is the technical kernel. Once the software requirements are
analyzed and modeled, system design is the last work in modeling phase and it also provide a base
for construction phase.

FUNCTIONALITY:

In single word system engineering implements „quality‟ to our software. It provides a model by
which we can convince our customer for the software to be developed.

Page - 62 -
SEQUENCE DIAGRAM:

USER ATM SCREEN VALIDATOR DATABASE

Enter card

Card details(not visible)

Details from card Relevant details from database

invalid
status

Prompt for PIN (valid)

User ready Enters PIN

Invalid (tries<=3) PIN Already stored PIN

status

Valid (Prompt for trans.)

Fig: Sequence diagram for card entry and entry of PIN

Page - 63 -
USER ATM SCREEN SYSTEM DATABASE

Valid (Prompt for trans.)

User ready selects transaction

Selected transaction & Data from database


Requisite data
Perform transaction
Acknowledgement

Updating of data
User session ends

Fig: Sequence diagram for performing transaction

Page - 64 -
CLASS DIAGRAMS:

Myjframe

JPanel
JButton
JLabel
TextField

Playing_Sound Font
Int

AudioInputStream DateTime
Is placed within &
DataLine Playing_Sound
Is part of Long
File
Clip String
Is placed within & PrintPanel
+Playing_Sound (String) Is part of PrintRequestAttributes
+Play () +Myjframe (String)
+Stop () +senseCard()
+textValueChanged(TextEvent)
+actionPerformed(ActionEvent)
+userTalked(String)
DateTime
+startThread ()

DateFormat
Date
String
Is used to build

+Datetime () AtmSimulatorFloppy
+getDate ()
+main (String [ ])
+getTime ()

Page - 65 -
USER INTERFACE DESIGN

Page - 66 -
INTRODUCTION:

User Interface Design means the interface through which user can interact with the software and
perform it requisite operations. This interface must user friendly as much as possible. It must not
force unnecessary stress on the end user and must be easy to use. The interface must also fulfill the
requirements that had been stated at the requirement elicitation and requirement inception phase.

USER INTERFACE DESIGN:

The user interface can be defined by the following snapshots of the user interface of our project. It
defines how a user can interact efficiently with the software.

Page - 67 -
1) The above interface defines the “Welcome Screen of our project”. The software
remains in the screen until the user doesn‟t insert the card (i.e. floppy drive). As soon as the
user enters the card properly the next screen is displayed.

Page - 68 -
2) This screen prompts the user to register by providing their personal details. It can be done by
either clicking on the respective fields and buttons or by speaking their choices. After
entering the required information and confirming the registration, the next screen is
displayed..

Page - 69 -
3) This screen prompts the user to provide their personal details. It can be done by either
clicking on the respective fields and buttons or by speaking their choices. After entering the
required personal details and confirming the information, the next screen is displayed.

Page - 70 -
4) This screen requests the user to enter their account details. This can be accomplished by either
clicking on the appropriate fields and buttons or by speaking their selections. Once the
necessary account details are entered and verified, the subsequent screen will be displayed.

Page - 71 -
5) This screen prompts the user to select their desired banking transaction. Options available include
Deposit, Withdrawal, Fast Cash, Mini Statement, PIN Change, Balance Enquiry, and Exit. Users can
easily make a selection by clicking on the corresponding buttons or by using voice commands. Once a
transaction type is chosen, the system will guide the user through the necessary steps to complete their
transaction efficiently and securely. Whether depositing funds, withdrawing cash, quickly accessing a
set amount with Fast Cash, viewing recent transactions with a Mini Statement, changing their PIN for
security, checking their account balance, or exiting the system, users can navigate the options with
ease..

Page - 72 -
6) When the user clicks on the Deposit option, they are prompted to enter the deposit amount,
either by typing it or using voice commands. After confirming the amount, the user is
instructed to insert cash or checks as appropriate. Once the transaction is processed, a
confirmation message is displayed, and the user can choose to print a receipt, make another
transaction, or return to the main menu.

Page - 73 -
7) When the user selects the Withdraw option, they are guided through the withdrawal process.
The user starts by entering the amount they wish to withdraw, either by typing it directly or
using voice commands. After confirming the withdrawal amount, the user is prompted to
choose the denominations for cash withdrawal if applicable. Once the transaction details are
confirmed, the user follows the instructions to receive the cash from the ATM or bank teller.
A confirmation message is displayed upon successful withdrawal, offering options to print a
receipt, conduct another transaction, or return to the main menu.

Page - 74 -
8) When the user selects the Mini Statement option, they are presented with a summary of their
recent transactions. The screen displays details such as transaction dates, descriptions, and
amounts for the latest transactions performed on their account. Users can scroll through the
list to view additional transactions or filter results based on specific criteria like date range or
transaction type. The Mini Statement provides a quick snapshot of account activity, helping
users monitor their finances conveniently. After reviewing their transactions, users can choose
to print the statement, perform another transaction, or return to the main menu.

Page - 75 -
9) When the user selects the PIN Change option, they are guided through the process of updating
their Personal Identification Number (PIN). The screen prompts the user to enter their current
PIN followed by their desired new PIN, ensuring security through encrypted input. After
confirming the new PIN, the system processes the change and displays a confirmation
message. Users are advised to memorize their new PIN and avoid sharing it with anyone to
maintain account security. They can then proceed to perform additional transactions, print a
receipt, or return to the main menu.

Page - 76 -
10) Selecting the Balance Enquiry option provides users with an instant view of their current
account balance. This screen displays detailed information including available funds, recent
transactions, and pending withdrawals, allowing users to quickly assess their financial status.
After reviewing their balance, users have the option to print a statement, proceed with another
transaction, or return to the main menu for further banking activities.

Page - 77 -
11) Choosing the Fast Cash option allows users to quickly withdraw a predefined amount of cash
from their account. Users select from predetermined withdrawal amounts such as $20, $50, or
$100, providing a convenient and efficient way to access cash without needing to specify an
exact amount. After selecting the desired amount, the system processes the transaction, and
users receive their cash promptly. A confirmation message is displayed, offering options to
print a receipt, perform another transaction, or return to the main menu.

Page - 78 -
12) After successfully completing the deposit transaction, users receive a confirmation message
indicating that the deposit has been processed. They have the option to print a receipt for their
records. Additionally, users can choose to perform another transaction or return to the main
menu to continue managing their accounts. The deposited funds will be reflected in their
account balance, ensuring they have accurate and up-to-date financial information for future
transactions and planning.

Page - 79 -
13) Upon successfully completing the withdrawal transaction, users receive a confirmation
message indicating that the requested amount has been dispensed. They have the option to
print a receipt for their records. Users can then choose to perform another transaction or
return to the main menu to manage their accounts further. The withdrawal amount will be
deducted from their account balance, ensuring accurate and up-to-date financial information
for future transactions and planning.

Page - 80 -
DATABASE SAMPLES IMAGES

Page - 81 -
Page - 82 -
Page - 83 -
IMPLEMENTATION

Page - 84 -
INTRODUCTION:
The implementation phase of software development is concerned with design specification with
source code. The primary goal of implementation is to write source code to its specification. The
code has to be easily verified, so that debugging, testing and maintenance can be eased. The goal can
be achieved by making the source code as clear and straightforward as possible.

DEVELOPMENT ENVIRONMENT:

Regarding the development environment of our project, it has two phases – first on a stand alone
system and second on a peer-to-peer network (containing two computers). Initially we have
developed the front end of the software in modules. Then we have designed the back end (i.e.
databases and its access through Java) or we can also say server end. Then for checking the
functioning in the distributed network we have deployed the software in network discussed above,
with one system as client and other system as server.

PROTOTYPING:

RAPID PROTOTYPING:

The RAD Model is an incremental process model with a rapid development phase. It is a high speed
adaptation of waterfall model. The rapid development is achieved by component based construction
process. If the software requirement is well defined and project scope is constrained then RAD model
can develop the project in a short time duration (i.e. 60 to 90 days).

Page - 85 -
Team n
(Modeling)

Team n
(Construct)

Team 2
(Modeling)
Communi- Planning
cation Team2 Deployment
(Construct)

Team 1
(Modeling)

Team 1
(Construct)

Fig: Rapid Prototyping


It requires less time and workload can be distributed. But on the other hand requires large no. of
human resources and high technical risk is associated.

INCREMENTAL PROTOTYPING:

It combines waterfall model in an iterative fashion. It uses the linear sequences in staggered form.
Each increment adds some additional functionality to software. For example consider word
processing software developed using this paradigm. Initially in the first increment only basic file
management, editing and documentation will be provided. At second increment sophisticated file
management, documentation and editing features will be available. At third increment spell check
feature will be added and so on.

Thus the first increment in an incremental model is often the core product. The core product refers to
the basic functionality and the supplementary functionality are provided at the later versions. The
core product is used by the customer. As result of used plan for next increment is produced. The next
increment must increase the functionality of the core product. This process continues till the complete
software is not provided.

Page - 86 -
Functionality

C P M K D

Increment n

C P M K D Increment 2

C P M K D Increment 1

Time
Fig: Incremental Prototyping

EVOLUTIONARY PROTOTYPING:

As we know that software occupies time. If during the development of software the business or
product requirement changes, then it leads to the development of software to be unrealistic. Also the
tight deadlines prevent the completion of comprehensive project. In such cases, only a limited version
product can be provided. To overcome the problem, we require a software process model, which can
accommodate a product explicitly and can modify itself with the product with the time. It is of two
types:
 Prototyping Model:
Often a customer defines the objective of software, but is unable to define the complete
details about input, processing and output. In such cases a prototype model is beneficial as
it guides the developer and the customer when the requirement is indistinct.

Page - 87 -
Communication

Deployment Quick Plan

Construction of Quick Design


Prototype

Fig: Prototyping Model

 Spiral Model:
A spiral model is an evolutionary process model that couples the iterative nature of
prototype model and semantic and control aspect of waterfall model. It produces the rapid
development of increment of the software. So we can say that spiral model results in
development of software in evolutionary releases. The first release may be prototype and
further release is a sophisticated software product.

PORTABILTY:

Platform for any software is defined as the combination of processor and operating system over
which the software runs. Platform dependent software is those that will run only on that platform for
which it has been constructed. For example if we construct a program in C language which is
running on a platform (Intel + Windows Xp) and if we run the same program on a computer having
LINUX operating system then the program will not run. So C doesn‟t support portability.

A platform is the hardware or software environment in which a program runs. The Java platform
differs from most other platforms in that it's a software-only platform that runs on top of other,
hardware-based platforms. Most other platforms are described as a combination of hardware and
operating system.

Page - 88 -
The Java platform has two components:

The Java Virtual Machine (Java VM)


The Java Application Programming Interface (Java API)

The Java API is a large collection of ready-made software components that provide many useful
capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries
(packages) of related components. The following figure depicts a Java program, such as an
application or applet, that's running on the Java platform. As the figure shows, the Java API and
Virtual Machine insulates the Java program from hardware dependencies.

Fig: Java as a programming language & a platform

As a platform-independent environment, Java can be a bit slower than native code. However, smart
compilers, well-tuned interpreters, and just-in-time byte code compilers can bring Java's
performance close to that of native code without threatening portability.

Regarding our project, it is portable. The reason for portability is the technology used i.e. JAVA. Java
itself is a portable language (supports platform independency). In the project first Java will create a
byte code (CLASS file) of our source code and after that this byte code can be made to execute on
any system irrespective of the platform. The only thing that can violate the portability of our project
is –if the version of JDK is less than 1.4.

Page - 89 -
SOURCE CODE

Sign up page 1
package bank.management.system;
import javax.swing.*;
import java.awt.*;
import java.util.*;
import com.toedter.calendar.JDateChooser;
import java.awt.event.*;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern;

public class SignupOne extends JFrame implements ActionListener {


JTextField nameTextField,
fnameTextField,emailTextField,addressTextField,cityTextField,stateTextField,pincodeTe
xtField;

long random;
JButton next;
JRadioButton male,female,other,married,unmarried;
JDateChooser dateChooser;

SignupOne()
{
setLayout(null);
Random ran = new Random();
random = Math.abs((ran.nextLong() % 9000L) + 1000L);//Math.abs(...): This
function returns the absolute value of a given number. It ensures that the result is a non-
negative value.
//ran.nextLong(): This generates a random long value using an instance of the Random
class named ran.

Page - 90 -
//% 9000L: The modulus operator % is used to find the remainder when dividing the
generated random long value by 9000. This effectively limits the range of the generated
number to values between 0 (inclusive) and 8999 (inclusive).
//+ 1000L: After taking the modulus, 1000 is added to the result. This shifts the range of
the generated number to be between 1000 (inclusive) and 9999 (inclusive).
//So, the entire line of code generates a random number in the range of 1000 to 9999.

JLabel formno = new JLabel("APPLICATION FORM NO. "+ random);


formno.setFont(new Font("Raleway ", Font.BOLD,38));
formno.setBounds(140, 20, 600, 40);
add(formno);

JLabel PersonalDetails = new JLabel("page 1: Personal Details.......");


PersonalDetails.setFont(new Font("Raleway ", Font.BOLD,22));
PersonalDetails.setBounds(290, 80, 400, 30);
add(PersonalDetails);

JLabel name =new JLabel("Name:");


name.setFont(new Font("Railay", Font.BOLD,20));
name.setBounds(100, 140, 200, 30);
add(name);

nameTextField = new JTextField();


nameTextField.setFont(new Font("Raleway",Font.BOLD, 20));
nameTextField.setBounds(300,140,400,30);
add(nameTextField);

JLabel fname =new JLabel("Father's Name:");


fname.setFont(new Font("Railay", Font.BOLD,20));
fname.setBounds(100, 190, 200, 30);
add(fname);

fnameTextField = new JTextField();


fnameTextField.setFont(new Font("Raleway",Font.BOLD, 20));
fnameTextField.setBounds(300,190,400,30);
add(fnameTextField);

JLabel dob =new JLabel("Date Of Birth:");


dob.setFont(new Font("Railay", Font.BOLD,20));
Page - 91 -
dob.setBounds(100, 240, 200, 30);
add(dob);

dateChooser= new JDateChooser();


dateChooser.setBounds(300,240,400,30);
dateChooser.setForeground(new Color(105,105,105));//because date color by default
green so we use foreground color change color
add(dateChooser);

JLabel gender =new JLabel("Gender:");


gender.setFont(new Font("Railay", Font.BOLD,20));
gender.setBounds(100, 290, 200, 30);
add(gender);

male =new JRadioButton("Male:");


male.setBounds(300, 290, 60, 30);
male.setBackground(Color.white);
add(male);

female =new JRadioButton("Female:");


female.setBounds(450, 290, 120, 30);
female.setBackground(Color.white);
add(female);

ButtonGroup gendergroup = new ButtonGroup();


gendergroup.add(male);
gendergroup.add(female);

JLabel email =new JLabel("Email Address:");


email.setFont(new Font("Railay", Font.BOLD,20));
email.setBounds(100, 340, 200, 30);
add(email);

emailTextField = new JTextField();


emailTextField.setFont(new Font("Raleway",Font.BOLD, 20));
emailTextField.setBounds(300,340,400,30);
add(emailTextField);

Page - 92 -
JLabel marital =new JLabel("Marital Status:");
marital.setFont(new Font("Railay", Font.BOLD,20));
marital.setBounds(100, 390, 200, 30);
add(marital);

married =new JRadioButton("Married:");


married.setBounds(300, 390, 100, 30);
married.setBackground(Color.white);
add(married);

unmarried =new JRadioButton("Unmarried:");


unmarried.setBounds(450, 390, 100, 30);
unmarried.setBackground(Color.white);
add(unmarried);

other =new JRadioButton("Other:");


other.setBounds(630, 390, 100, 30);
other.setBackground(Color.white);
add(other);

ButtonGroup maritalgroup = new ButtonGroup();//use for select only one radio


button
maritalgroup.add(married);
maritalgroup.add(unmarried);
maritalgroup.add(other);

JLabel address =new JLabel("Address:");


address.setFont(new Font("Railay", Font.BOLD,20));
address.setBounds(100, 440, 200, 30);
add(address);

addressTextField = new JTextField();


addressTextField.setFont(new Font("Raleway",Font.BOLD, 20));
addressTextField.setBounds(300,440,400,30);
add(addressTextField);

JLabel city =new JLabel("City:");


city.setFont(new Font("Raleway", Font.BOLD,20));
city.setBounds(100, 490, 200, 30);
Page - 93 -
add(city);

cityTextField = new JTextField();


cityTextField.setFont(new Font("Raleway",Font.BOLD, 20));
cityTextField.setBounds(300,490,400,30);
add(cityTextField);

JLabel state =new JLabel("State:");


state.setFont(new Font("Raleway", Font.BOLD,20));
state.setBounds(100, 540, 200, 30);
add(state);

stateTextField = new JTextField();


stateTextField.setFont(new Font("Raleway",Font.BOLD, 20));
stateTextField.setBounds(300,540,400,30);
add(stateTextField);

JLabel pincode=new JLabel("Pin Code:");


pincode.setFont(new Font("Raleway", Font.BOLD,20));
pincode.setBounds(100, 590, 200, 30);
add(pincode);

pincodeTextField = new JTextField();


pincodeTextField.setFont(new Font("Raleway", Font.BOLD,20));
pincodeTextField.setBounds(300, 590, 400, 30);
add(pincodeTextField);

next = new JButton("Next");


next.setBackground(Color.BLACK);
next.setForeground(Color.WHITE);
next.setBounds(620,660,80,30);
next.addActionListener(this);
add(next);

getContentPane().setBackground(Color.WHITE);//use for get all the content from


the whole form
Page - 94 -
setSize(850,800);
setLocation(350,10);
setVisible(true);

}
public void actionPerformed (ActionEvent ae){
String formno = "" + random;//long
String name =nameTextField.getText();
String fname =fnameTextField.getText();
String dob = ((JTextField)
dateChooser.getDateEditor().getUiComponent()).getText();
//for get date a class in datechooser .getDataEditor and in getEditor we have
.getUiComponent
String gender = null;
if(male.isSelected())
{
gender = "Male";
}else if(female.isSelected()){//isSelected for check and compair
gender = "Female";
}

String email = emailTextField.getText();

String marital = null;

if (married.isSelected()){

marital = "Married";
}

else if(unmarried.isSelected()){
marital ="Unmarried";
}

else if(other.isSelected()){
marital ="Other";
Page - 95 -
}
String address = addressTextField.getText();
String city = cityTextField.getText();
String state = stateTextField.getText();
String pincode = pincodeTextField.getText();

try{
if(name.equals("")){

JOptionPane.showMessageDialog(null,"Name Is Required");//use for validate and


show massaage

else if(fname.equals("")){
JOptionPane.showMessageDialog(null,"Father's Name Is Required");//use for
validate and show massaag
}

else if(dob.equals("")){

JOptionPane.showMessageDialog(null,"Date Of Birth Is Required");//use for


validate and show massaage
}

else if(gender.equals("")){
JOptionPane.showMessageDialog(null,"Gender Is Required");//use for
validate and show massaage
}

// else if(!(email.equals("" ))){

// JOptionPane.showMessageDialog(null,"Email Is Required");//use for validate


and show massaage
// }

else if(marital.equals("")){

JOptionPane.showMessageDialog(null,"Marital Status Is Required");//use for validate


Page - 96 -
and show massaage

}
else if(address.equals("")){

JOptionPane.showMessageDialog(null,"Address Is Required");//use for validate and


show massaage
}

else if(city.equals("")){

JOptionPane.showMessageDialog(null,"City Is Required");

else if(state.equals("")){

JOptionPane.showMessageDialog(null,"State Is Required");

}
else if(pincode.equals("")){

JOptionPane.showMessageDialog(null,"Pin Code Is Required");

}
else{
Conn c = new Conn();
String query = "insert into signup
values('"+formno+"','"+name+"','"+fname+"','"+dob+"','"+gender+"','"+email+"','"+marita
l+"','"+address+"','"+city+"','"+state+"','"+pincode+"')";

c.s.executeUpdate(query);

setVisible(false);
new SignupTwo(formno).setVisible(true);//we pass here form no to sent in
signup two the same form no for enter relete the user data is a same user
}
}
catch (Exception e){
Page - 97 -
System.out.println(e);
}

}
public static void main(String args[])
{
new SignupOne();

}
}

Sign up page 2
package bank.management.system;

import javax.swing.*;
import java.awt.*;
import java.util.*;
import com.toedter.calendar.JDateChooser;
import java.awt.event.*;

public class SignupTwo extends JFrame implements ActionListener {

JComboBox religion,category,occupation,education,income;

JTextField pan,aadhar;

JRadioButton syes,sno,eyes,eno;
ButtonGroup sgroup,egroup;

JButton next;
String formno;

Page - 98 -
SignupTwo(String formno)// this is a constructor to get form no
{
this.formno = formno; // we take form no here
setLayout(null);

JLabel AdditionalDetails = new JLabel("page 2: Additional Details.......");


AdditionalDetails.setFont(new Font("Raleway ", Font.BOLD,22));
AdditionalDetails.setBounds(290, 80, 400, 30);
add(AdditionalDetails);

JLabel religion1 =new JLabel("Religion:");


religion1 .setFont(new Font("Railay", Font.BOLD,20));
religion1.setBounds(100, 140, 200, 30);
add(religion1);

String valReligion[] = {"Hindu","Kattuwa","sikh", "Christian","Others"};// this a


value type array we pass in combo box
religion = new JComboBox(valReligion);//this is code two create a coombo box
religion.setBounds(300,140,400,30);
religion.setBackground(Color.WHITE);
add(religion);

JLabel category1 =new JLabel("Category:");


category1 .setFont(new Font("Railay", Font.BOLD,20));
category1.setBounds(100, 190, 200, 30);
add(category1);

String valCategory[] = {"General","OBC","SC", "ST","Others"};


category = new JComboBox(valCategory);
category.setBounds(300,190,400,30);
category.setBackground(Color.WHITE);
add(category);

JLabel Income =new JLabel("Income:");


Income .setFont(new Font("Railay", Font.BOLD,20));
Income .setBounds(100, 240, 200, 30);
add(Income );
Page - 99 -
String incomeCategory[] = {"Null","< 1,50,000","< 2,50,000", "< 5,00,000","Upto
10,00,000"};
income = new JComboBox(incomeCategory);
income .setBounds(300,240,400,30);
income.setBackground(Color.WHITE);
add(income);

JLabel Eduacation =new JLabel("Educational:");


Eduacation.setFont(new Font("Railay", Font.BOLD,20));
Eduacation.setBounds(100, 290, 200, 30);
add(Eduacation);

JLabel Education=new JLabel("Qualification:");


Education.setFont(new Font("Raleway", Font.BOLD,20));
Education.setBounds(100, 315, 200, 30);
add(Education);

String educationValues[] = {"Below 10th","10th","12th", "Graduation","Post


Graduation","p.h.d","Others"};
education= new JComboBox(educationValues);
education .setBounds(300,300,400,30);
education.setBackground(Color.WHITE);
add(education );

JLabel Occupation =new JLabel("Occupation:");


Occupation.setFont(new Font("Railay", Font.BOLD,20));
Occupation.setBounds(100, 360, 200, 30);
add(Occupation);

String occupationValues[] = {"Salaried","Self Employed","Bussiness",


"Student","Retired","Others"};
occupation= new JComboBox(occupationValues);
occupation .setBounds(300,360,400,30);
occupation.setBackground(Color.WHITE);
add(occupation );

Page - 100 -
JLabel panNumber =new JLabel("PAN Number:");
panNumber .setFont(new Font("Railay", Font.BOLD,20));
panNumber .setBounds(100, 420, 200, 30);
add(panNumber );

pan = new JTextField();


pan .setFont(new Font("Raleway",Font.BOLD, 20));
pan .setBounds(300,420,400,30);
add( pan );

JLabel aadharNumber =new JLabel("Aadhar Number:");


aadharNumber .setFont(new Font("Railay", Font.BOLD,20));
aadharNumber .setBounds(100, 480, 200, 30);
add(aadharNumber );

aadhar = new JTextField();


aadhar.setFont(new Font("Raleway",Font.BOLD, 20));
aadhar.setBounds(300,480,400,30);
add(aadhar);

JLabel seniorCitizen =new JLabel("Senior Citizen:");


seniorCitizen.setFont(new Font("Raleway", Font.BOLD,20));
seniorCitizen.setBounds(100, 540, 200, 30);
add(seniorCitizen);

syes =new JRadioButton("Yes");


syes.setBounds(300, 540, 100, 30);
syes.setBackground(Color.white);
add(syes);

sno=new JRadioButton("No");
sno.setBounds(450, 540, 100, 30);
sno.setBackground(Color.white);
add(sno);

sgroup = new ButtonGroup();


sgroup.add(syes);
sgroup.add(sno);

Page - 101 -
JLabel exisitingAccount =new JLabel("Exisiting Account:");
exisitingAccount.setFont(new Font("Raleway", Font.BOLD,20));
exisitingAccount.setBounds(100, 600, 200, 30);
add(exisitingAccount);

eyes =new JRadioButton("Yes");


eyes.setBounds(300, 600, 100, 30);
eyes.setBackground(Color.white);
add(eyes);

eno =new JRadioButton("No");


eno.setBounds(450, 600, 100, 30);
eno.setBackground(Color.white);
add(eno);

egroup = new ButtonGroup();


egroup.add(eyes);
egroup.add(eno);

next = new JButton("Next");


next.setBackground(Color.BLACK);
next.setForeground(Color.WHITE);
next.setBounds(620,660,80,30);
next.addActionListener(this);
add(next);

getContentPane().setBackground(Color.WHITE);//use for get all the content from


the whole form

setSize(850,800);
setLocation(350,10);
Page - 102 -
setVisible(true);

}
public void actionPerformed (ActionEvent ae){

String sreligion =(String) religion.getSelectedItem();//it is a function


(getSelectedItem )is used to get Item from ComboBox its allways give a object
String scategory =(String) category.getSelectedItem();//we need a string value so
that Type cast in string.
String sincome =(String) income.getSelectedItem();
String seducation =(String) education.getSelectedItem();
String soccupation =(String)occupation.getSelectedItem();

String seniorcitizen = null;

if(syes.isSelected()){
seniorcitizen = "Yes";

}else if(sno.isSelected()){
seniorcitizen = "No";
}

String exisitingaccount = null;

if(eyes.isSelected()){
exisitingaccount= "Yes";

}else if (eno.isSelected()){
exisitingaccount = "No";
}

String span = pan.getText();


String saadhar = aadhar.getText();

try{
Page - 103 -
Conn c = new Conn();
String query = "insert into signuptwo
values('"+formno+"','"+sreligion+"','"+scategory+"','"+sincome+"','"+seducation+"','"+soc
cupation+"','"+span+"','"+saadhar+"','"+seniorcitizen+"','"+exisitingaccount+"')";

c.s.executeUpdate(query);

//signupThree object

setVisible(false);
new SignupThree(formno).setVisible(true);
}
catch (Exception e){
System.out.println(e);
}

}
public static void main(String args[])
{
new SignupTwo("");//we pass here empaty string because we dont have any default
constructor here

}
}

Sign up page 3
package bank.management.system;

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

public class SignupThree extends JFrame implements ActionListener {

JRadioButton r1,r2,r3,r4;
Page - 104 -
JCheckBox c1,c2,c3,c4,c5,c6,c7;
JButton submit, cancel;
String formno;

SignupThree( String formno){

this.formno = formno;

setLayout(null);

JLabel l1 =new JLabel("Page 3: Account Details");


l1.setFont(new Font("Raleway", Font.BOLD,22));
l1.setBounds(280, 30, 400, 40);
add(l1);

JLabel type =new JLabel("Account Type");


type.setFont(new Font("Raleway", Font.BOLD,22));
type.setBounds(100, 120, 200, 30);
add(type);

r1= new JRadioButton("Saving Account");


r1.setFont(new Font("Raleway", Font.BOLD,16));
r1.setBackground(Color.WHITE);
r1.setBounds(100,160,160,20);
add(r1);

r2= new JRadioButton("Fixed Deposit Account");


r2.setFont(new Font("Raleway", Font.BOLD,16));
r2.setBackground(Color.WHITE);
r2.setBounds(350,160,250,20);
add(r2);

r3= new JRadioButton("Current Account");


r3.setFont(new Font("Raleway", Font.BOLD,16));
r3.setBackground(Color.WHITE);
r3.setBounds(100,200,160,20);
add(r3);

r4= new JRadioButton("Recurring Deposit Account");


Page - 105 -
r4.setFont(new Font("Raleway", Font.BOLD,16));
r4.setBackground(Color.WHITE);
r4.setBounds(350,200,250,20);
add(r4);

ButtonGroup groupaccount = new ButtonGroup();


groupaccount.add(r1);
groupaccount.add(r2);
groupaccount.add(r3);
groupaccount.add(r4);

JLabel card =new JLabel("Card Number");


card .setFont(new Font("Raleway", Font.BOLD,22));
card .setBounds(100, 250, 200, 30);
add(card );

JLabel number =new JLabel("XXXX-XXXX-XXXX-1433");


number .setFont(new Font("Raleway", Font.BOLD,22));
number .setBounds(330, 250, 300, 30);
add(number );

JLabel carddetails =new JLabel("Your 16 Digits Card Number");


carddetails .setFont(new Font("Raleway", Font.BOLD,12));
carddetails.setBounds(100, 270, 200, 30);
add(carddetails );

JLabel pin =new JLabel("PIN: ");


pin .setFont(new Font("Raleway", Font.BOLD,22));
pin .setBounds(100, 320, 200, 20);
add(pin );

JLabel pindetails =new JLabel("Your 4 Digits Password");


pindetails .setFont(new Font("Raleway", Font.BOLD,12));
pindetails.setBounds(100, 340, 300, 20);
add(pindetails );

JLabel pinnumber =new JLabel("XXXX");


pinnumber .setFont(new Font("Raleway", Font.BOLD,22));
pinnumber .setBounds(330, 320, 300, 20);
add(pinnumber );
Page - 106 -
JLabel services=new JLabel("Services Required:");
services .setFont(new Font("Raleway", Font.BOLD,22));
services.setBounds(100, 400, 200, 20);
add(services );

c1 = new JCheckBox("ATM CARD");


c1.setBounds(100,450,200,30);
c1.setBackground(Color.WHITE);
c1.setFont(new Font("Raleway",Font.BOLD,16));
add(c1);

c2 = new JCheckBox("Internet Banking");


c2.setBounds(350,450,200,30);
c2.setBackground(Color.WHITE);
c2.setFont(new Font("Raleway",Font.BOLD,16));
add(c2);

c3 = new JCheckBox("Mobile Banking");


c3.setBounds(100,500,200,30);
c3.setBackground(Color.WHITE);
c3.setFont(new Font("Raleway",Font.BOLD,16));
add(c3);

c4 = new JCheckBox("EMAIL & SMS Alerts");


c4.setBounds(350,500,200,30);
c4.setBackground(Color.WHITE);
c4.setFont(new Font("Raleway",Font.BOLD,16));
add(c4);

c5 = new JCheckBox("Cheque Book");


c5.setBounds(100,550,200,30);
c5.setBackground(Color.WHITE);
c5.setFont(new Font("Raleway",Font.BOLD,16));
add(c5);

c6 = new JCheckBox("E-Ststement");
c6.setBounds(350,550,200,30);
c6.setBackground(Color.WHITE);
Page - 107 -
c6.setFont(new Font("Raleway",Font.BOLD,16));
add(c6);

c7 = new JCheckBox("I hereby declares that the above entered details are correct to the
best of my knowledge");
c7.setBounds(100,600,600,30);
c7.setBackground(Color.WHITE);
c7.setFont(new Font("Raleway",Font.BOLD,12));
add(c7);

submit = new JButton("Submit");


submit.setBackground(Color.BLACK);
submit.setForeground(Color.WHITE);
submit.setFont(new Font("Raleway", Font.BOLD,14));
submit.setBounds(200,650,100,30);
submit.addActionListener(this);
add(submit);

cancel = new JButton("Cancel");


cancel.setBackground(Color.BLACK);
cancel.setForeground(Color.WHITE);
cancel.setFont(new Font("Raleway", Font.BOLD,14));
cancel.setBounds(350,650,100,30);
cancel.addActionListener(this);
add( cancel);

getContentPane().setBackground(Color.WHITE);

setSize(800,750);
setLocation(350, 0);
setVisible(true);

}
public void actionPerformed(ActionEvent ae){// function overwriting
if(ae.getSource() == submit) {

String accountType = null;

if(r1.isSelected()){

Page - 108 -
accountType = "Saving Account";
}
else if(r2.isSelected()){
accountType = "Fixed Deposit Account";
}
else if(r3.isSelected()){

accountType = "Current Account";


}
else if(r3.isSelected()){

accountType = "Recurring Deposit Account";


}

Random random = new Random();

String cardnumber ="" + Math.abs((random.nextLong() % 90000000L )+


5040936000000000L);

String pinnumber = "" + Math.abs((random.nextLong() % 9000L) + 1000L);

String facility = "";

if(c1.isSelected()){

facility = facility + "ATM Card";


}
else if(c2.isSelected()){
facility = facility + "Internet Banking";
}
else if(c3.isSelected()){
facility = facility + "Mobile Banking";
}
else if(c4.isSelected()){
facility = facility + "EMAIL & SMS Alerts";
}
else if(c5.isSelected()){
facility = facility + "Cheque Book";
}
else if(c6.isSelected()){
Page - 109 -
facility = facility + "E-Ststement";
}

try{
if (accountType.equals(""))
{
JOptionPane.showMessageDialog(null, "Account Type Is Required");
}else{
Conn conn = new Conn();
String query1 = "insert into signupthree
values('"+formno+"','"+accountType+"','"+cardnumber+"','"+pinnumber+"','"+facility+"')
";
String query2 = "insert into login
values('"+formno+"','"+cardnumber+"','"+pinnumber+"')";
conn.s.executeUpdate(query1);
conn.s.executeUpdate(query2);
}

JOptionPane.showMessageDialog(null, "Card Number: " + cardnumber + "\n


PIN: " + pinnumber);

setVisible(false);
new Deposit(pinnumber).setVisible(false);//we use the code for Deposite money

}catch (Exception e){


System.out.println(e);
}

} else if (ae.getSource() == cancel){

setVisible(false);
new Login().setVisible(true);
}

public static void main(String args[]){


Page - 110 -
new SignupThree("");
}

Login page
package bank.management.system;

import javax.swing.*; //java extend package javax.swing import this package for use JFrame

import java.awt.*;// use for Image class

import java.awt.event.*;// use for ActionListener class

import java.sql.*; // use ResultSet class

public class Login extends JFrame implements ActionListener{


JButton login, signup, clear;
JTextField cardTextField;
JPasswordField pinTextField;

Login(){// this ia a constructore

setLayout(null);// because jframe by default use border Layout so if we use costome Layout we
write this code

setTitle("AUTOMATED TELLER MACHINE");// setTitle is use for give title of frame

ImageIcon i1= new ImageIcon(ClassLoader.getSystemResource("icons/logo.jpg"));//this a code to


load a image lets describ the code
//(ImageIcon :-use for any image in the project,(i1:-this is the object of image icon,)(ClassLoader:-
this is a function for load the image class in the class
//ClassLoder function we use a function(getSystemResource("location of the image")we pass the
location in getSystemResource function for access the image))

Image i2 = i1.getImage().getScaledInstance( 100, 100, Image.SCALE_DEFAULT); //we use this


code for costomise the size of image;

ImageIcon i3 = new ImageIcon(i2);//to convert image icon into a image beacuse we can not put a
image icon in a Jlable directly

Page - 111 -
JLabel label = new JLabel(i3);//for put the image in JFrame;

label.setBounds(70,10,100,100);// use for channge the location of icon

add(label);//use for add the label in frame

JLabel text = new JLabel("WELCOME TO ATM");// use for heading

text.setFont(new Font("Osward",Font.BOLD, 38));// use for text font

text.setBounds(200,40,400,40);// for location

add(text);

JLabel cardno = new JLabel("Card No:");// use for heading

cardno.setFont(new Font("Raleway",Font.BOLD, 28));// use for text font

cardno.setBounds(120,150,150,30);// for location


add(cardno);

cardTextField = new JTextField();//use for textfield


cardTextField.setBounds(300,150,230,30);// for location
cardTextField.setFont(new Font("Arial",Font.BOLD, 14));
add(cardTextField);

JLabel pin = new JLabel("PIN:");// use for heading

pin.setFont(new Font("Raleway",Font.BOLD, 28));// use for text font

pin.setBounds(120,220,250,30);// for location


add(pin);

pinTextField = new JPasswordField();//use for textfield


pinTextField.setBounds(300,220,230,30);// for location

pinTextField.setFont(new Font("Arial",Font.BOLD, 14));


add(pinTextField);

login = new JButton("SIGN IN");


login.setBounds(300,300,100,30);
login.setBackground(Color.BLACK);// use for background color
login.setForeground(Color.WHITE);// use for upper color which is upper on background color

login.addActionListener(this);
add(login);

Page - 112 -
clear = new JButton("CLEAR");
clear.setBounds(430,300,100,30);
clear.setBackground(Color.BLACK);// use for background color
clear.setForeground(Color.WHITE);// use for upper color which is upper on background color

clear.addActionListener(this);//for performer the button click event


add(clear);

signup = new JButton("SIGN UP");


signup.setBounds(300, 350,230,30);
signup.setBackground(Color.BLACK);// use for background color
signup.setForeground(Color.WHITE);// use for upper color which is upper on background color

signup.addActionListener(this);
add(signup);

getContentPane().setBackground(Color.WHITE);//use for background color (getContentPane() get


all contant from form and background use color

setSize(800,480);//this a code for create a frame 480 is hight and 800 is width of a frame

setVisible(true);//because the frame is by default hidden so we use the code for seen the frame

setLocation(350,200);//we use the setLocation for giving the title of the frame by default the frame
location is top left
}

public void actionPerformed(ActionEvent ae){//use for overWrite the action function and perform
action

if(ae.getSource()== clear){

cardTextField.setText("");
pinTextField.setText("");

}else if(ae.getSource()== login){

Conn conn = new Conn();


String cardnumber = cardTextField.getText();
Page - 113 -
String pinnumber = pinTextField.getText();

String query = "select * from login where cardnumber = '"+cardnumber+"'and pinnumber =


'"+pinnumber+"'";

try{
ResultSet rs = conn.s.executeQuery(query);

if(rs.next()){
setVisible(false);
new Transactions(pinnumber).setVisible(true);

}else
{
JOptionPane.showMessageDialog(null, "Incorrect Card Number Or Pin");
}

}catch(Exception e){
System.out.println(e);
}

}else if(ae.getSource()== signup){


setVisible(false);
new SignupOne().setVisible(true);
}

}
public static void main(String args[]){

new Login();// this is a class object when we create a object than first constructore are called with
same class name

}
}

Transactions page
package bank.management.system;

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

Page - 114 -
public class Transactions extends JFrame implements ActionListener {

JButton deposit,withdrawl,fastcash,ministatement,pinchange,balanceenquiry,exit;
String pinnumber;

Transactions(String pinnumber)
{
this.pinnumber = pinnumber;
setLayout (null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg"));


Image i2 = i1.getImage().getScaledInstance(800,800,Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0, 0, 750, 750);
add(image);

JLabel text = new JLabel("Please Select Your Transaction");


text.setBounds(175,230,700,35);
text.setForeground(Color.WHITE);
text.setFont(new Font("System", Font.BOLD,16));
image.add(text);

deposit = new JButton("Deposite");


deposit.setBounds(110,345,130,28);
deposit.addActionListener(this);
image.add(deposit);

withdrawl = new JButton("Withdrawl");


withdrawl.setBounds(310,345,130,28);
withdrawl.addActionListener(this);
image.add(withdrawl);

fastcash = new JButton("Fast Cash");


fastcash.setBounds(110,378,130,28);
fastcash.addActionListener(this);
image.add(fastcash);

ministatement = new JButton("Mini Statement");


ministatement.setBounds(310,375,130,28);
ministatement.addActionListener(this);
image.add(ministatement);

pinchange = new JButton("PIN Change");


Page - 115 -
pinchange.setBounds(110,410,130,28);
pinchange.addActionListener(this);
image.add(pinchange);

balanceenquiry = new JButton("Balance Enquiry");


balanceenquiry.setBounds(310,405,130,28);
balanceenquiry.addActionListener(this);
image.add(balanceenquiry);

exit = new JButton("Exit");


exit.setBounds(310,435,130,28);
exit.addActionListener(this);
image.add( exit);

setSize(750,750);
setLocation(300,0);
setUndecorated(true);
setVisible(true);

public void actionPerformed(ActionEvent ae){

if (ae.getSource() == exit){
System.exit(0);

}else if (ae.getSource() == deposit){


setVisible(false);
new Deposit(pinnumber).setVisible(true);

}else if(ae.getSource()== withdrawl){

setVisible(false);
new Withdrawl (pinnumber).setVisible(true);

}else if (ae.getSource() == fastcash){

setVisible(false);
new FastCash(pinnumber).setVisible(true);

}else if (ae.getSource() == pinchange)


{
setVisible(false);
new PinChange(pinnumber).setVisible(true);
Page - 116 -
}
else if (ae.getSource() == balanceenquiry)
{
setVisible(false);
new BalanceEnquiry(pinnumber).setVisible(true);

} else if (ae.getSource() == ministatement)


{

new MiniStatement(pinnumber).setVisible(true);
}

}
public static void main(String args[]){

new Transactions("");

}
}

Deposit page
package bank.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class Deposit extends JFrame implements ActionListener{

JTextField amount;
JButton deposit,back;
String pinnumber;

Deposit(String pinnumber){ // we get pin number here for deposit action

this.pinnumber = pinnumber;

Page - 117 -
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg"));


Image i2 = i1.getImage().getScaledInstance(750,750, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0,0,750,750);
add(image);

JLabel text = new JLabel("Enter The You Want To Deposit");


text.setForeground(Color.WHITE);
text.setFont(new Font("System", Font.BOLD,16));
text.setBounds(160,250,350,20);
image.add(text);

amount = new JTextField();


amount.setFont(new Font("Raleway", Font.BOLD,22));
amount.setBounds(150,280,270,40);
image.add(amount);

deposit = new JButton("Deposit");


deposit.setBounds(315,405,120,27);
deposit.addActionListener(this);
image.add(deposit);

back = new JButton("Back");


back.setBounds(315,435,120,27);
back.addActionListener(this);
image.add(back);

setSize(750,750);
setLocation(350,0);
setUndecorated(true);
setVisible(true);

public void actionPerformed(ActionEvent ae){


if(ae.getSource() == deposit){

String number = amount.getText(); //get amount by textField


Page - 118 -
Date date = new Date();// use for get Date Current use by system
if(number.equals("")){

JOptionPane.showMessageDialog(null,"Please Enter The Amount You Want To Deposite");

}
else {

try{
Conn conn = new Conn();

String query = "insert into bank values('"+pinnumber+"','"+date+"','Deposit','"+number+"')";


conn.s.executeUpdate(query);
JOptionPane.showMessageDialog(null, "RS "+number+" Deposited Successfully");
setVisible(false);
new Transactions(pinnumber).setVisible(true);
}
catch(Exception e){
System. out.println(e);
}
}

}if (ae.getSource() == back){

setVisible(false);
new Transactions(pinnumber).setVisible(true);// if we press back button than we go back
transaction class with pin;

public static void main(String args[])


{
new Deposit("");
}
}

Page - 119 -
Withdrawal page
package bank.management.system;

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

public class Withdrawl extends JFrame implements ActionListener{

JTextField amount;
JButton withdraw,back;
String pinnumber;

Withdrawl(String pinnumber){ // we get pin number here for deposit action

this.pinnumber = pinnumber;
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg"));


Image i2 = i1.getImage().getScaledInstance(750,750, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0,0,750,750);
add(image);

JLabel text = new JLabel("Enter The You Want To Withdraw");


text.setForeground(Color.WHITE);
text.setFont(new Font("System", Font.BOLD,16));
text.setBounds(160,250,350,20);
image.add(text);

amount = new JTextField();


amount.setFont(new Font("Raleway", Font.BOLD,22));
amount.setBounds(150,280,270,40);
image.add(amount);

withdraw = new JButton("Withdraw");


withdraw.setBounds(315,405,120,27);
withdraw.addActionListener(this);
image.add(withdraw);

Page - 120 -
back = new JButton("Back");
back.setBounds(315,435,120,27);
back.addActionListener(this);
image.add(back);

setSize(750,750);
setLocation(350,0);
setUndecorated(true);
setVisible(true);

public void actionPerformed(ActionEvent ae){


if(ae.getSource() == withdraw){

String number = amount.getText(); //get amount by textField


Date date = new Date();// use for get Date Current use by system
if(number.equals("")){

JOptionPane.showMessageDialog(null,"Please Enter The Amount You Want To Withdraw");

}
else {

try{
Conn conn = new Conn();

String query = "insert into bank


values('"+pinnumber+"','"+date+"','Withdrawl','"+number+"')";
conn.s.executeUpdate(query);
JOptionPane.showMessageDialog(null, "RS "+number+" Withdraw Successfully");
setVisible(false);
new Transactions(pinnumber).setVisible(true);
}
catch(Exception e){
System. out.println(e);
}
}

Page - 121 -
}if (ae.getSource() == back){

setVisible(false);
new Transactions(pinnumber).setVisible(true);// if we press back button than we go back
transaction class with pin;

public static void main(String args[])


{
new Withdrawl("");
}
}

Balance enquiry
package bank.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

public class BalanceEnquiry extends JFrame implements ActionListener{


String pinnumber;
JButton back;

BalanceEnquiry(String pinnumber){
this.pinnumber = pinnumber;
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg"));


Image i2 = i1.getImage().getScaledInstance(750, 750, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0,0,750,750);
add(image);

back = new JButton("BACK");

Page - 122 -
back.setBounds(340,430,95,30);
back.addActionListener(this);
image.add(back);

Conn c = new Conn();


int balance = 0;
try{

ResultSet rs = c.s.executeQuery ("select * from bank where pinnumber = '"+pinnumber+"'") ;//


in this query we get all information wich i connect with pinnumber

while(rs.next()){

if(rs.getString("type").equals("Deposit")){

balance += Integer.parseInt(rs.getString("amount"));// know about this line

}else{
balance -= Integer.parseInt(rs.getString("amount"));// knoe this line
}

}
}catch (Exception e){
System.out.println(e);
}

JLabel text = new JLabel("Your Current Account balance is RS " + balance);


text.setForeground(Color.WHITE);
text.setBounds(150,250,370,30);
image.add(text);

setSize(750,750);
setLocation(300,0);
setUndecorated(true);
setVisible(true);
}

public void actionPerformed(ActionEvent ae){


setVisible(false);
new Transactions(pinnumber).setVisible(true);

}
public static void main(String args[]){
Page - 123 -
new BalanceEnquiry("");
}
}

Fast cash
package bank.management.system;

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

public class FastCash extends JFrame implements ActionListener {

JButton r1,r2,r3,r4,r5,r6,back;
String pinnumber;

FastCash(String pinnumber)
{
this.pinnumber = pinnumber;
setLayout (null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg"));


Image i2 = i1.getImage().getScaledInstance(800,800,Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0, 0, 750, 750);
add(image);

JLabel text = new JLabel("SELECT WITHDRAWL AMOUNT");


text.setBounds(175,230,700,35);
text.setForeground(Color.WHITE);
text.setFont(new Font("System", Font.BOLD,16));
image.add(text);

r1 = new JButton("RS 100");


r1 .setBounds(110,345,130,28);
r1.addActionListener(this);
image.add( r1 );
Page - 124 -
r2 = new JButton("RS 500");
r2.setBounds(310,345,130,28);
r2.addActionListener(this);
image.add(r2);

r3 = new JButton("RS 1000");


r3.setBounds(110,378,130,28);
r3.addActionListener(this);
image.add(r3);

r4 = new JButton("RS 2000");


r4 .setBounds(310,375,130,28);
r4 .addActionListener(this);
image.add( r4 );

r5 = new JButton("RS 5000");


r5.setBounds(110,410,130,28);
r5.addActionListener(this);
image.add( r5);

r6 = new JButton("RS 10000");


r6 .setBounds(310,405,130,28);
r6 .addActionListener(this);
image.add( r6 );

back = new JButton("BACK");


back.setBounds(310,435,130,28);
back.addActionListener(this);
image.add( back);

setSize(750,750);
setLocation(300,0);
setUndecorated(true);
setVisible(true);

public void actionPerformed(ActionEvent ae){

if (ae.getSource() == back){
setVisible(false);
new Transactions(pinnumber).setVisible(true);

Page - 125 -
}else {
String amount = ((JButton)ae.getSource()).getText().substring(3);//ae.getSource we use to get
value its always return a object so we use JButton
// and substring use to remove the sub string wors like RS 500 so we remove RS and Space use 3

Conn c = new Conn();

try{
ResultSet rs = c.s.executeQuery ("select * from bank where pinnumber = '"+pinnumber+"'") ;//
in this query we get all information wich i connect with pinnumber

int balance = 0;
while(rs.next()){

if(rs.getString("type").equals("Deposit")){

balance += Integer.parseInt(rs.getString("amount"));// know about this line

}else{
balance -= Integer.parseInt(rs.getString("amount"));// knoe this line
}
}
if(ae.getSource() != back && balance < Integer.parseInt(amount)){

JOptionPane.showMessageDialog(null, "Insufficient Balance");


return;
}
Date date = new Date();
String query = "insert into bank values('"+pinnumber+"','"+date+"',
'Withdrawl','"+amount+"')";
c.s.executeUpdate(query);

JOptionPane.showMessageDialog(null, "Rs" + amount+ "Debited Successfully");

setVisible(false);
new Transactions(pinnumber).setVisible(true);

}catch(Exception e){
System.out.println(e);
}
}

Page - 126 -
}
public static void main(String args[]){

new FastCash("");

}
}

PIN change
package bank.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class PinChange extends JFrame implements ActionListener {

JPasswordField pin,repin;
JButton change, back;
String pinnumber;

PinChange(String pinnumber){
this.pinnumber = pinnumber;

setLayout(null) ;

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg"));


Image i2 = i1.getImage().getScaledInstance(750, 750, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0,0,750,750);
add(image);

JLabel text = new JLabel(" Change Your Pin");


text.setForeground(Color.WHITE);
text.setFont(new Font("System", Font.BOLD,20));
text.setBounds(200, 240, 450, 30);

Page - 127 -
image.add(text);

JLabel pintext = new JLabel("New PIN:");


pintext.setForeground(Color.WHITE);
pintext.setFont(new Font("System", Font.BOLD,20));
pintext.setBounds(135, 290, 130, 20);
image.add(pintext);

pin = new JPasswordField();


pin.setFont(new Font("Raleway", Font.BOLD,20));
pin.setBounds(270, 290, 160, 25);
image. add(pin);

JLabel repintext = new JLabel("Re-Enter PIN:");


repintext .setForeground(Color.WHITE);
repintext .setFont(new Font("System", Font.BOLD,20));
repintext .setBounds(135, 330, 140, 20);
image.add( repintext );

repin = new JPasswordField();


repin.setFont(new Font("Raleway", Font.BOLD,20));
repin.setBounds(270, 330, 160, 25);
image.add(repin);

change = new JButton("CHANGE");


change.setBounds(285,405,150,25);
change.addActionListener(this);
image.add(change);

back = new JButton("BACK");


back.setBounds(285,435,150,25);
back.addActionListener(this);
image.add(back);

setSize(750,750);
setLocation(300,0);

setUndecorated(true);
setVisible(true);

}
public void actionPerformed(ActionEvent ae){
if (ae.getSource()== change){

Page - 128 -
try{
String npin = pin.getText();
String rpin = repin.getText();

if(!npin.equals(rpin)){
JOptionPane.showMessageDialog(null, "Entered PIN does not match");
return;
}
if(npin.equals("")){
JOptionPane.showMessageDialog(null, "Please Enter New PIN ");
return;
}
if(rpin.equals("")){
JOptionPane.showMessageDialog(null, "Please Re-Enter New PIN ");
return;
}

Conn conn = new Conn();


String query1 = "update bank set pinnumber = '"+rpin+"' where pinnumber = '"+pinnumber+"'";
String query2 = "update login set pinnumber = '"+rpin+"' where pinnumber = '"+pinnumber+"'";
String query3 = "update signupthree set pinnumber = '"+rpin+"' where pinnumber =
'"+pinnumber+"'";

conn.s.executeUpdate(query1);
conn.s.executeUpdate(query2);
conn.s.executeUpdate(query3);

JOptionPane.showMessageDialog(null, "PIN change successfully");

setVisible(false);
new Transactions(rpin).setVisible(true);//we pass here new pin because pin is updated
}catch (Exception e){

System.out.println(e);
}
}else{

setVisible(false);
new Transactions(pinnumber).setVisible(true);
}

Page - 129 -
public static void main(String args[])
{
new PinChange("").setVisible(true);
}

Mini statement
package bank.management.system;
import java.awt.*;
import javax.swing.*;
import java.sql.*;

public class MiniStatement extends JFrame{

MiniStatement(String pinnumber){

setTitle("Mini Statement");

setLayout(null);

JLabel mini = new JLabel();


mini.setBounds(20,140,400,200);;
add(mini);

JLabel bank = new JLabel("State Bank Of India");


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

JLabel card = new JLabel();


card.setBounds(20,80,300,20);
add(card);

JLabel balance = new JLabel();


balance.setBounds(20,400,300,20);
add(balance);

try{
Conn conn = new Conn();
ResultSet rs = conn.s.executeQuery("select * from login where pinnumber = '"+pinnumber+"'");

Page - 130 -
while(rs.next()){
card.setText("Card Number: " + rs.getString("cardnumber").substring(0,4)+( "XXXXXXXX") +
rs.getString("cardnumber").substring(12));
}
}catch(Exception e){

System.out.println(e);
}

try{
Conn conn = new Conn();

int balance1 = 0;
ResultSet rs = conn.s.executeQuery("select * from bank where pinnumber = '"+pinnumber+"'");
while(rs.next())
{
mini.setText(mini.getText() + "<html>" + rs.getString("date")+
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"

+ rs.getString("type") +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + rs.getString("amount") +
"<br><br><html>");

if(rs.getString("type").equals("Deposit")){

balance1 += Integer.parseInt(rs.getString("amount"));// know about this line

}else{
balance1 -= Integer.parseInt(rs.getString("amount"));// knoe this line
}
}

balance.setText("Your current Account Balance Is RS " +balance1);

}catch(Exception e){

System.out.println(e);
}

setSize(400,600);

Page - 131 -
setLocation(20,20);
getContentPane().setBackground(Color.WHITE);
setUndecorated(true);
setVisible(true);

public static void main(String args[]){


new MiniStatement("");

Page - 132 -
TESTING

Page - 133 -
TESTING STRATEGIES:

UNIT TESTING:

Unit Testing is a testing mechanism that tests the modules of our software. It can be carried out after
the coding or before the coding. A component level design act as guide for testing of modules. The
unit testing tests the control paths to uncover errors within the boundaries of modules. The unit
testing mainly focuses on the internal processing level and data structure of a component. Testing of
each module can be carried out in the following parts:
 Module Interface
 Local data structure
 Independent paths
 Boundary values
 Error handling statements

Interface
Local Data Structures
Module
Independent Paths
Boundary Values
Error Handling

Test Cases

Fig: Unit Testing


The unit testing begins with the testing of modules interface. In this the flow of information from or
to module interface is checked. After this the data stored in local data structures are checked for

Page - 134 -
integrity. After that all independent paths are checked whether they are checked at least once. After
this the boundary values are checked against the control flow, data structures at the boundaries of
input domain. At last the tests are conducted for the error handling statements for identifying any
errors (if present) and error handling routines.

INTEGRATION TESTING:

Integration testing is a systematic technique that describes software architecture and at the same time
checks the errors encountered in the interfaces. The main objective of integration testing is to use the
unit tested modules and design architecture as depicted by design.

The normal tendency is to follow non-incremental integration testing. In which all the components
are combined and structure is obtained and afterwards testing is performed. But the best way is to
follow incremental testing in which the program is constructed and tested increments and errors can
be easily isolated and corrected. There are two types of incremental testing:

 Top-down incremental integration testing


 Bottom-up incremental integration testing

Top-Down Integration Testing:

Top-down incremental testing is a mechanism for constructing software architecture and testing at
the same time. In this approach the process of integration begins from the top where the main control
is taken first. Then as we move towards bottom each module is integrated and simultaneously tested.
The main control module act as a driver and the module sub-ordinate requires are replaced by stubs.
Depth first integration and Breadth first integration are two approaches for integration of modules.

Page - 135 -
Bottom-up Integration Testing:

In bottom-up integration the integration of module begins from the lowest level. Since the module at
the lowest level are already integrated and tested, so stubs are eliminated.

FUNCTION TESTING:

Black Box testing or Functional testing is a mechanism to check the functionality of our program. By
applying black box testing tester will be able to get a test case that checks the functionality of ones
program.

Black Box testing can be used to find the following errors:


 To find incorrect or missing functions.
 Interface errors.
 Data structures and data access to external database error.
 Behavior and performance error.
 Initialization and termination errors.

Black Box testing is done to check that software functions are operational i.e. input is properly
accepted & output is correctly produced & the integrity of the external information is maintained. It
is usually applied at the later phase of testing. It can be performed by following four methods:

 Graph Based methods.


 Equivalence partitioning.
 Boundary value analysis.
 Orthogonal array testing.

Page - 136 -
SYSTEM TESTING:

System testing is actually a series of different tests whose primary purpose is to fully exercise the
computer based system. Through this it is checked whether all system elements have been properly
integrated and perform allocated functions. It includes the following testing:

 Recovery Testing: If there is a system fault then the system must resume processing
within a certain period of time. So it allows a tester to cause faults in various cases and
look for the resume duration.
 Security Testing: It tests whether the security measures possessed by our software is
capable of stopping the illegal access.
 Stress Testing: Stress testing checks the stress that can be beard by our software. For this
the tester runs the software with abnormal quantity, frequency and volume of resources.
 Performance Testing: Performance testing is usually done to check the performance of
program at run time. For this hardware and software instrumentation is needed.

TESTING CONSIDERED:

In our project we have performed the following testing:


 White Box Testing
 Black Box Testing
 Unit Testing
 Integration Testing

Initially we have tested the unit modules. And within each module we have performed black box
testing to check whether the modules is accepting the input(zero or many) or not and against that
input it is producing correct output or not. If it is producing the output but it is logically wrong then
white box testing is performed to check the internal functionality of modules i.e. the logical control
flows and details.

Page - 137 -
After performing unit testing on all modules we integrate them to form big modules. Here we have
used incremental bottom-up integration testing. In this we have integrated the modules starting from
bottom and the cluster is tested. At the final step the entire system is tested.

Page - 138 -
FUTURE WORK

Page - 139 -
The future work that can be done in the project are as follows:

 More speech patterns can be stored to import security.


 The use of Bio-metric authentication (finger print) can import more security as the card and
PIN will not be used further.

Page - 140 -
CONCLUSION

Page - 141 -
As a matter of fact this project is completed in twelve months and this duration is divided into two
sections, six months of collecting information, planning and literature survey and next six months of
implementing it. First, the theoretical section where I have learned lots of things regarding ATM
machines (e.g.…functioning features and services provided), regarding simulation, simulators and
needs of simulation. Along with these we have also learned some concepts of RMI (Remote Method
Invocation) and JDBC (Java Database Connectivity) in Java. Having an ATM Simulator as a major
project helps me to better understand the concepts of Object Oriented Programming principles,
Software Engineering principles and concepts regarding simulation and modeling.

In this duration I have tried to plan the simulator in such a manner that it not only covers all the
features and facilities of modern real ATM but an enhancement is also suggested. This simulator
also provides the environment in which new enhancements can be performed on it, before they are
equipped on the real world ATM machines. The use of speech synthesis and speech recognition
helps the software more user friendly. The speech synthesis guides the user for performing the
transactions and speech recognition facilitates the user to perform the transaction through speech.
This speech mechanism thus helps the rural people to use the ATM without extra overhead of
remembering the procedure for maintaining the transactions. As speech synthesis will guide them
and speech recognition will allow them to use their speech to perform transactions.

And in these six months we have implemented the software in such a way that it fulfils all the
objectives that had been stated in the first six months. Also we have performed the different testing
strategies.

Page - 142 -
REFERENCES

Page - 143 -
BOOKS REFFERED:

 JAVA 5 Programming (Black Book) by Kogent Solutions.


 Core Java 1.5 (Advanced Features) by Cary Hortsman & Gray Cornell.
 Database Concepts by Navathe.
 Database Concepts by Korth.
 Software Engineering Principles by Roger Pressman

WEBSITE REFFERED:

 www.cloudgarden.com
 www.google.com
 www.java.sun.com

Page - 144 -
Page - 145 -
Page - 146 -

You might also like