0% found this document useful (0 votes)
48 views20 pages

Yuvi PDF

The document describes a GUI-based ATM banking system project created in Java. It allows users to perform transactions like withdrawals, deposits, balance checks across checking and savings accounts. The project uses various Java GUI components like buttons, labels, text fields to build the interface.

Uploaded by

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

Yuvi PDF

The document describes a GUI-based ATM banking system project created in Java. It allows users to perform transactions like withdrawals, deposits, balance checks across checking and savings accounts. The project uses various Java GUI components like buttons, labels, text fields to build the interface.

Uploaded by

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

KL UNIVERSITY

FRESHMEN ENGINEERING DEPARTMENT


A Project Based Lab Report

on

ATM SYSTEM
 
SUBMITTED BY:
I.D NUMBER ​NAME

​190040664 ​ ​ M. Yuvaraj Ujwal

​UNDER THE ESTEEMED GUIDANCE OF   

A.KRISHNA​,   

​ (ASST .PROFESSOR) 

 
 
 
 
KL UNIVERSITY 
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India
DEPARTMENT OF BASIC ENGINEERING SCIENCES
 
 
 
 

 
CERTIFICATE

This is to certify that the project based laboratory report entitled


“ATM SYSTEM​” ​submitted by Mr./Ms​. M.Yuvaraj Ujwal, ​bearing Regd. No.
190040664 to the ​Department of Basic Engineering Sciences, KL University
in partial fulfillment of the requirements for the completion of a project based
Laboratory in ​“OBJECT ORIENTED PROGRAMMING” course in I year B Tech II
Semester, is a bonafide record of the work carried out by him/her under my
supervision during the academic year 2019 – 2020​.

PROJECT SUPERVISOR HEAD OF THE DEPARTMENT

P.NEELAKANTESWARA Dr. D. HARITHA


​ ​ACKNOWLEDGEMENTS
 
It is a great pleasure for me to express my gratitude to our honorable
President ​SRI.KONERU SATYANARAYANA​, for giving the opportunity and
platform with facilities in accomplishing the project-based laboratory report.

I express the sincere gratitude to our principal for his administration


towards our academic growth.

I express sincere gratitude to our Coordinator and HOD-BES for his


leadership and constant motivation provided in successful completion of our
academic semester. I record it as my privilege to deeply thank for providing us
the efficient faculty and facilities to make our ideas into reality.

I express my sincere thanks to our project supervisor


P.NEELAKANTESWARA for his/her novel association of ideas, encouragement,
appreciation and intellectual zeal which motivated us to venture this project
successfully.

Finally, it is pleased to acknowledge the indebtedness to all those who


devoted themselves directly or indirectly to make this project report success​.

NAME ID NUMBER

M.Yuvaraj Ujwal 190040664


​ABSTRACT
 
The project is about the feedback that is given by students about the
faculty. The feedback for teachers for different sections and students are
different. this data in a separate file such that each section has its own separate
file from which he can retrieve the data anytime. This is done by using a GUI
(Graphical User Interface) .
A GUI of an application built using ​java ​is made up of layers of containers. The
first layer is the window used to move the application around the screen of your
computer. It is a top-level container that gives all other containers and graphical
components a place to work in. ​In this, the components of GUI used are Button ,
Textfield and Label.
INDEX OF THE PROJECT
S.NO TITLE PG.NO

​1.​ ​ ​INTRODUCTION TO THE PROJECT ​ 6

2. ​ AIM OF THE PROJECT ​ 7

3. ​SYSTEM REQUIREMENTS​ 8

4. ​FUTURE SCOPE OF THE PROJECT​ 8

5. ​CLASS DIAGRAM​ 9

6. ​ ALGORITHM 10

7. IMPLEMENTATION 11-17

8. INTEGRATION AND SYSTEM


TESTING 18-19

9. CONCLUSION 20
​ INTRODUCTION
The ATM Banking system project is based on a concept of managing an
account personally. From this system, the user can check total balance, Deposit
Amount and Withdraw Amounts easily as it is not time-consuming. The whole
project is developed in “JAVA” Programming language, different variables and
strings have been used for the development of this project. We used the GUI in
the project.
AIM OF THE PROJECT
 
The main aim of this project is to create a GUI which would
contain the Services needed to be accessed like amount withdrawals ,
Deposit, Pin generation, Balance enquiry , Balance statements, Savings
Account. Then using GUI we would Display the Services. All the
information that was Stored will be displayed using this ATM Banking
System.And by using JFrames we can use multiple Windows and
Message boxes.
SYSTEM REQUIREMENTS
 
➤ SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:

Language : Java

Operating system​: ​Windows Xp or later.

➤ HARDWARE REQUIREMENTS​:
The hardware requirements that map towards the software are as follows:

RAM : 8GB

Processor :64-bit processor

FUTURE SCOPE OF THE PROJECT

The future scope of the project is mainly to learn more use of the GUI and
use the concept to design other projects and also add some methods to the
program inorder to make it more efficient and functional.
CLASS DIAGRAM

 
 
 
 
ALGORITHM
 
 
Step 1 : Create a JFrame.

Step 2 : Create a JTextfield.

Step 3 : Create a JLabel for providing input of subjects.

Step 4 : Create JLabels for asking the feedback questions.

Step 5 : Create Jbuttons for choosing and submitting feedback.

Step 6 : Create Combo boxes for the subject to be selected and the teacher to be
given feedback.
IMPLEMENTATION
​package​ pp;
import​ javax.swing.*;
import​ java.awt.*;
import​ java.awt.event.ActionEvent;
import​ java.awt.event.ActionListener;
import​ java.text.DecimalFormat;
public​ ​class​ ATM ​extends​ JFrame
{
​private​ ​static​ ​final​ ​long​ ​serialVersionUID​ = 1L;
​static​ ​final​ ​int​ ​WINDOWWIDTH​ = 350, ​WINDOWHEIGHT​ = 200;
​static​ ​final​ ​int​ ​TEXTWIDTH​ = 225, ​TEXTHEIGHT​ = 25;

​private​ JButton withdrawButton = ​new​ JButton("Withdraw");


​private​ JButton depositButton = ​new​ JButton("Deposit");
​private​ JButton transferToButton = ​new​ JButton("Transfer To");
​private​ JButton balanceButton = ​new​ JButton("Balance");
​private​ JRadioButton checkingRadio = ​new​ JRadioButton("Checking");
​private​ JRadioButton savingsRadio = ​new​ JRadioButton("Savings");
​private​ JTextField entry = ​new​ JTextField("");
​private​ ButtonGroup radios = ​new​ ButtonGroup();
​private​ JOptionPane frame = ​new​ JOptionPane();

​private​ ​static​ Account ​checking​ = ​new​ Account().​new​ Checking();


​private​ ​static​ Account ​savings​ = ​new​ Account().​new​ Savings();
​private​ ​static​ DecimalFormat ​df​ = ​new​ DecimalFormat("$0.00");
​public​ ​static​ ​void​ makeAccounts(​double​ checkingStartingBalance,​double
savingsStartingBalance)
{
​checking​.setBalance(checkingStartingBalance);
​savings​.setBalance(savingsStartingBalance);
}

​ ublic​ ​void​ errorValidNumber()


p
{
JOptionPane.​showMessageDialog(​ frame, "Please enter a valid amount. " +"\n If
withdrawing, please use $20 increments.");
}

c​ lass​ WithdrawButtonListener ​implements​ ActionListener


{
​public​ ​void​ actionPerformed(ActionEvent e)
{
​try
{
​if​ (getEntryValue() > 0 && getEntryValue() % 20 == 0)
{
​if​ (checkingRadio.isSelected())
{
​checking​.withdraw(getEntryValue());
JOptionPane.​showMessageDialog(​ frame, ​df.​ format(getEntryValue()) +
" withdrawn from Checking.");
}
​else​ ​if​ (savingsRadio.isSelected())
{
​savings​.withdraw(getEntryValue());
JOptionPane.​showMessageDialog(​ frame, ​df.​ format(getEntryValue()) +"
withdrawn from Savings.");
}
clearEntryValue();
}
​else​ errorValidNumber();
clearEntryValue();
}
​catch​ (InsufficientFunds insufficientFunds)
{
System.​out​.println("Funds Insufficient!");
}
}
}
​class​ DepositButtonListener ​implements​ ActionListener
{
​public​ ​void​ actionPerformed(ActionEvent e)
{
​if​ (getEntryValue() > 0)
{
​if​ (checkingRadio.isSelected())
{
​checking.​ deposit(getEntryValue());
JOptionPane.​showMessageDialog​(frame, ​df​.format(getEntryValue()) +" deposited
into Checking.");
}
​else​ ​if​ (savingsRadio.isSelected())
{
​savings.​ deposit(getEntryValue());
JOptionPane.​showMessageDialog​(frame, ​df​.format(getEntryValue()) + "
deposited into Savings.");
}
clearEntryValue();
} ​else
errorValidNumber();
clearEntryValue();
}
}
​class​ TransferToButtonListener ​implements​ ActionListener
{
​public​ ​void​ actionPerformed(ActionEvent e) {
​try
{
​if​ (getEntryValue() > 0)
{
​if​ (checkingRadio.isSelected())
{
​savings​.transferFrom(getEntryValue());
​checking​.transferTo(getEntryValue());
JOptionPane.​showMessageDialog(​ frame, ​df.​ format(getEntryValue()) +"
transferred from Savings to Checking.");
}
​else​ ​if​ (savingsRadio.isSelected())
{
​checking​.transferFrom(getEntryValue());
​savings​.transferTo(getEntryValue());
JOptionPane.​showMessageDialog(​ frame, ​df.​ format(getEntryValue()) +"
transferred from Checking to Savings.");
}
clearEntryValue();
} ​else
errorValidNumber();
clearEntryValue();
}
​catch​ (InsufficientFunds insufficientFunds)
{
System.​out​.println("Insufficient Funds!");
}
}
}
​class​ BalanceButtonListener ​implements​ ActionListener
{
​public​ ​void​ actionPerformed(ActionEvent e)
{
​if​ (checkingRadio.isSelected())
{
JOptionPane.​showMessageDialog(​ frame,"Your checking account balance is: \n" +
df​.format(​checking​.getBalance()));
}
​else​ ​if​ (savingsRadio.isSelected())
{
JOptionPane.​showMessageDialog(​ frame,"Your savings account balance is: \n"
+​df​.format(​savings​.getBalance()));
}
​else​ errorValidNumber();
clearEntryValue();
}
}
​public​ ATM(​double​ checkingStartingBalance, ​double​ savingsStartingBalance)
{
s​ uper​("ATM Machine");
setLayout(​new​ GridBagLayout());
GridBagConstraints layout = ​new​ GridBagConstraints();
setFrame(​WINDOWWIDTH​, ​WINDOWHEIGHT​);
JPanel buttonPanel = ​new​ JPanel();
JPanel textEntry = ​new​ JPanel();
setResizable(​false​);
layout.gridy = 2;
add(buttonPanel);
add(textEntry, layout);
buttonPanel.setLayout(​new​ GridLayout(3, 2, 10, 10));
textEntry.setLayout(​new​ GridLayout(1, 1));
buttonPanel.add(withdrawButton);
buttonPanel.add(depositButton);
buttonPanel.add(transferToButton);
buttonPanel.add(balanceButton);
radios.add(checkingRadio);
radios.add(savingsRadio);
buttonPanel.add(checkingRadio);
buttonPanel.add(savingsRadio);
entry.setPreferredSize(​new​ Dimension(​TEXTWIDTH​, ​TEXTHEIGHT)​ );
checkingRadio.setSelected(​true​);
textEntry.add(entry);

​makeAccounts(​ checkingStartingBalance, savingsStartingBalance);

withdrawButton.addActionListener(​new​ WithdrawButtonListener());
depositButton.addActionListener(​new​ DepositButtonListener());
transferToButton.addActionListener(​new​ TransferToButtonListener());
balanceButton.addActionListener(​new​ BalanceButtonListener());
}
​public​ ​double​ getEntryValue()
{
​try
{
​return​ Double.​parseDouble​(entry.getText());
}
​catch​ (NumberFormatException e)
{
System.​out.​ println("Enter Correctly\n");
clearEntryValue();
​return​ 0;
}
}
​public​ ​void​ clearEntryValue()
{
entry.setText("");
}
​private​ ​void​ setFrame(​int​ width, ​int​ height)
{
setSize(width, height);

setLocationRelativeTo(​null​);

setDefaultCloseOperation(JFrame.​EXIT_ON_CLOSE)​ ;

​public​ ​void​ display()


{

setVisible(​true​);

​public​ ​static​ ​void​ main(String[] args)


{

ATM frame = ​new​ ATM(1000, 1000);

frame.display();

}
public​ ​class​ Account
{
​private​ ​double​ balance;
​public​ Account()
{

}
​public​ ​void​ setBalance(​double​ balance)
{
​this​.balance = balance;
}
​public​ ​double​ getBalance()
{
​return​ ​this​.balance;
}
​public​ ​class​ Checking ​extends​ Account
{
​public​ Checking()
{

}
}
​public​ ​class​ Savings ​extends​ Account
{
​public​ Savings()
{

}
}
​public​ ​void​ withdraw(​double​ withdrawAmount) ​throws​ InsufficientFunds
{
​if​ (​this​.balance - withdrawAmount < 0)
{
​throw​ ​new​ InsufficientFunds();
}
​this​.balance = ​this​.balance - withdrawAmount;
}

​public​ ​void​ deposit(​double​ depositAmount)


{
​this​.balance = ​this​.balance + depositAmount;
}

​public​ ​void​ transferTo(​double​ transferAmount)


{
​this​.balance = ​this​.balance + transferAmount;
}

​ ublic​ ​void​ transferFrom(​double​ transferAmount) ​throws​ InsufficientFunds


p
{
i​ f​ (​this​.balance - transferAmount < 0)
{
​throw​ ​new​ InsufficientFunds();
}

​this​.balance = ​this​.balance - transferAmount;


}
}
import​ javax.swing.JOptionPane;
public​ ​class​ InsufficientFunds ​extends​ Exception
{
​public​ InsufficientFunds()
{
JOptionPane frame = ​new​ JOptionPane();
JOptionPane.​showMessageDialog​(frame, "Insufficient Funds!");
}
}
INTEGRATION AND SYSTEM TESTING
OUTPUTS
Screen Shots:
CONCLUSION
The project has met the needs to the extent possible. The project gives the output
as the ATM Machine as shown earlier.

After learning the GUI we will be able to modify the inputs and outputs and can
further modify the code with less time complexity.

Thus, through this project the concept of GUI is learnt and we will we able to code
programs on GUI.

You might also like