0% found this document useful (0 votes)
37 views26 pages

ATM 542 Merged

Uploaded by

aervaneha reddy
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)
37 views26 pages

ATM 542 Merged

Uploaded by

aervaneha reddy
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/ 26

A

Project Report on
ATM MACHINE
Submitted for partial fulfilment of the requirements for the award of the degree
of

BACHELOR OF TECHNOLOGY IN COMPUTER


SCIENCE AND ENGINEERING
By
N. Dhanush Reddy - 22K81A0542

Under the Guidance of


Mr. Y. Peer Mohideen
Assistant Professor

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


St. MARTIN'S ENGINEERING COLLEGE
UGC Autonomous
Affiliated to JNTUH, Approved by AICTE
Accredited by NBA & NAAC A+, ISO 9001-2008 Certified
Dhulapally, Secunderabad-500 100
www.smec.ac.in

JANUARY - 2024
St. MARTIN'S ENGINEERING COLLEGE
UGC Autonomous
Accredited by NBA & NAAC A+
Dhulapally, Secunderabad-500 100
www.smec.ac.in

CERTIFICATE
This is to certify that the project entitled “VENDING MACHINE” is being
submitted by N. Dhanush Reddy (22K81A0542) in fulfilment of the requirement
for the award of degree of BACHELOR OF TECHNOLOGY IN COMPUTER
SCIENCE AND ENGINEERING is recorded of bonafide work carried out by
them. The result embodied in this report have been verified and found satisfactory.

Project Internal Examiner Signature of HOD


Mr. Y. Peer Mohideen Dr. R. Santhosh Kumar
Assistant Professor Professor and Head of Department
Department of CSE Department of CSE
St. MARTIN'S ENGINEERING COLLEGE
UGC Autonomous
Accredited by NBA & NAAC A+
Dhulapally, Secunderabad-500100
www.smec.ac.in

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DECLARATION

We, the students of “Bachelor of Technology in Department of Computer


Science and Engineering”, session: 2022 - 2026, St. Martin’s Engineering
College, Dhulapally, Kompally, Secunderabad, hereby declare that the work
presented in this project work entitled ATM MACHINE is the outcome of our
own bonafide work and is correct to the best of our knowledge and this work has
been undertaken taking care of Engineering Ethics. This result embodied in this
project report has not been submitted in any university for award of any degree.

N. Dhanush Reddy (22K81A0542)


ACKNOWLEDGEMENT

The satisfaction and euphoria that accompanies the successful completion of any
task would be incomplete without the mention of the people who made it possible
and whose encouragement and guidance have crowded our efforts with success.
First and foremost, we would like to express our deep sense of gratitude and
indebtedness to our College Management for their kind support and permission to
use the facilities available in the Institute.
We especially would like to express our deep sense of gratitude and indebtedness
to Dr. P. SANTOSH KUMAR PATRA, Group Director, St. Martin’s
Engineering College Dhulapally, for permitting us to undertake this project.
We wish to record our profound gratitude to Dr. M. SREENIVAS RAO,
Principal, St. Martin’s Engineering College, for his motivation and
encouragement.
We are also thankful to Dr. R. SANTHOSH KUMAR, Head of the Department,
Computer Science And Engineering, St. Martin’s Engineering College,
Dhulapally, Secunderabad, for his support and guidance throughout our project.
We would like to express our sincere gratitude and indebtedness to our project
supervisor Mr. Y. Peer Mohideen Assistant Professor, Department of Computer
Science and Engineering, St. Martins Engineering College, Dhulapally, for his/her
support and guidance throughout our project. Finally, we express thanks to all
those who have helped us successfully completing this project. Furthermore, we
would like to thank our family and friends for their moral support and
encouragement. We express thanks to all those who have helped us in successfully
completing the project.

N. Dhanush Reddy (22K81A0542)


CONTENTS

CHAPTER 1- ABSTRACT 1

CHAPTER 2- INTRODUCTION 2

CHAPTER 3- SYSTEM ANALYSIS 3

3.1 EXISTING SYSTEM 3

3.2 PROPOSED SYSTEM 3

CHAPTER 4- SYSTEM REQUIREMENTS 4

4.1 HARDWARE REQUIREMENT 4

4.2 SOFTWARE REQUIREMENT 4

CHAPTER 5- ALGORITHM 5

CHAPTER 6- SYSTEM IMPLEMENTATION 6

CHAPTER 7- SYSTEM TESTING 15

CHAPTER 8- OUTPUT SCREENS 17

CHAPTER 9- CONCLUSION 19

CHAPTER 10- FUTURE ENHANCEMENTS 20

CHAPTER 11- REFERENCES 21


1. ABSTRACT

The Program titled ‘ATM MACHINE’ is implemented in JAVA, The Java code represents a rudimentary
yet functional ATM system with an intuitive graphical user interface developed using the Swing library. It
comprises two main classes: `Login` and `ATM`. The `Login` class orchestrates the initial interaction,
prompting users to input a personal identification number (PIN) with a limited number of attempts. Upon
successful authentication, users are seamlessly redirected to the `ATM` class, where the primary
transactional functionalities unfold. Within the `ATM` interface, users are empowered to engage in a variety
of financial operations, including withdrawals of specific denominations (₹500, ₹1000, and ₹2000), fund
deposits, balance inquiries, and the seamless termination of the session through the log-out option. Each of
these functionalities is intricately implemented through event listeners, ensuring responsive user interactions.
The GUI employs Swing components for an interactive and visually appealing layout.The code incorporates
fundamental input validation, guaranteeing that withdrawal operations are contingent upon adequate account
balances. The system maintains an organized transaction history, offering users a comprehensive receipt
upon concluding their ATM session. Despite the program's operational efficiency, opportunities for
enhancement abound. Modularizing the code, adopting constants to replace magic numbers, refining error
handling mechanisms, and implementing robust security practices, especially concerning sensitive data like
PINs, are areas for improvement. Furthermore, the user interface could benefit from design refinements to
enhance usability and provide a more polished and user-friendly experience.

1
2. INTRODUCTION

The JAVA-based ‘ATM MACHINE’ introduces a comprehensive implementation of an Automated Teller


Machine (ATM) system, showcasing the synergy of robust backend logic and a user-friendly graphical
interface developed using the Swing library. This program emulates key functionalities of a real-world ATM,
seamlessly integrating security measures, transaction handling, and user interactions. The code encompasses
two primary classes: `Login` and `ATM`. The `Login` class orchestrates the initial user authentication
process, prompting users to enter a Personal Identification Number (PIN) while ensuring a secure and limited
number of attempts. Upon successful authentication, users are seamlessly transitioned to the `ATM` class,
which serves as the central hub for financial transactions. Within the `ATM` interface, users can effortlessly
perform various operations, including withdrawals of specific denominations (₹500, ₹1000, and ₹2000), fund
deposits, balance inquiries, and the graceful termination of their session through the log-out option. The
utilization of event listeners and Swing components ensures a responsive and visually engaging user
experience. While the code demonstrates fundamental ATM functionalities, it also sets the stage for potential
refinements and improvements. Opportunities for modularization, constants for code readability, enhanced
error handling, and the incorporation of advanced security measures are highlighted. Furthermore, the user
interface design could be further polished for an even more intuitive and aesthetically pleasing user
experience. This introduction lays the foundation for a comprehensive exploration of the code's intricacies,
functionalities, and avenues for future enhancements.

2
3. SYSTEM ANALYSIS

3.1 EXISTING SYSTEM

The current code represents a basic ATM system with a Swing-based GUI. It includes a PIN-based
login system, allowing users to perform transactions such as withdrawals, deposits, and balance
inquiries. The user interface provides a straightforward yet functional experience.

3.2 PROPOSED SYSTEM

The proposed system aims to elevate the existing ATM simulation by introducing modular design
for improved organization, advanced security measures including secure credential storage, enhanced
user feedback and validation, enum-based representation of transaction types for readability, and a
polished user interface with improved aesthetics and user-friendly features. These enhancements
collectively aim to provide a more secure, maintainable, and engaging ATM experience.

3
4 . SYSTEM REQUIREMENTS

4.1 HARDWARE REQUIREMENTS

1. Operating System: The code is written in Java, so it is platform independent. It can run on
variousoperating systems such as Windows, Linux, and macOS.
2. Processor (CPU): A basic processor with moderate speed is sufficient. The code does not have
intensive processing requirements.
3. Memory (RAM): A small amount of RAM is needed to run desktop applications. Typically, 2GB
or more of RAM should be more than enough.
4. Storage: The storage requirements are minimal. The code itself is small, and the game data is
managed within the application. A few megabytes of free storage space would be more than adequate.
5. Graphics: The code uses Java's Swing library for GUI, which is not graphics-intensive. Most
standard integrated graphics solutions on modern computers should handle it without any issues.
6. Input Devices: The game is designed to be played with a mouse or touchpad for clicking on the
graphical buttons.

4.2 SOFTWARE REQUIREMENTS


7. Java Development Kit (JDK): Ensure that you have the Java Development Kit installed on your
system. You can download the latest version of JDK from the official Oracle website or use an open-
source alternative like OpenJDK.
8. Integrated Development Environment (IDE): While an IDE is not strictly necessary, it can
greatly facilitate Java development. Common IDEs include Eclipse, IntelliJ IDEA, and NetBeans.
Choose an IDE based on your preference and install it.
9. Java Swing Library: The Swing library is part of the Java Foundation Classes (JFC) and is
included in the standard Java API. You don't need to install it separately; it comes with the JDK.
10. Java Runtime Environment (JRE): For running the compiled Java program, you need the
Java Runtime Environment installed on your system. If you have the JDK installed, the JRE is
typically included.
11. GUI Environment: Since this is a graphical desktop application, you need an environment
that supports GUI. Make sure your system has a working graphical environment, especially if
you're running on a server or a minimal installation of Linux

4
5. ALGORITHM

STEP 1: START
STEP 2: Initialize crucial variables for managing the ATM system, including `balance`,
`inputSequence`, `transactionHist`, `inputSequenceIndex`, `transactionIndex`, and `readyToEnter`.
STEP 3: Implement the Login Screen, verifying the PIN, and allowing limited login attempts before
transitioning to the ATM screen.
STEP 4: Initialize the ATM screen, configure UI components, display the current balance, and
provide transaction instructions.
STEP 5: Define button actions:
- Withdraw Buttons: Check and deduct funds, provide feedback on success or insufficient funds.
- Quit Button: Display a receipt, bid farewell, and return to the login screen.
- Clear Button: Reset input, update display, and deactivate `readyToEnter`.
- Number Buttons (0-9): Capture input if `readyToEnter` is true.
- Enter Button: Process input, update balance, transaction history, and display transaction outcome.
STEP 6: Manage a dynamic `transactionList` ArrayList to record each transaction for user reference.
STEP 7: Implement a method to generate a comprehensive receipt containing the transaction history.
STEP 8: Maintain a continuous loop for user-friendly interactions; exit the loop upon user request.
STEP 9: Allow users to return to the login screen for subsequent sessions, ensuring a secure process.
STEP 10: STOP

5
6. SYSTEM IMPLEMENTATION

SOURCE CODE

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

class Login extends JFrame {

String pin = "1234";


int attempts = 3;

public Login() {
super("Login Screen");
setLayout(new BorderLayout());
setResizable(false);
setLocationRelativeTo(null);
buildApp();
pack();
setSize(250, 110);
setVisible(true);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}

public static void main(String[] args) {


new Login();
}

void buildApp() {

JLabel pinInstruction = new JLabel("Please enter your pin number");


JPasswordField pinText = new JPasswordField(4);
JButton entPin = new JButton("Enter");
JButton quit = new JButton("Quit");
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
buttonPanel.add(quit);
buttonPanel.add(entPin);
pinText.setBackground(Color.white);
add(pinInstruction, BorderLayout.NORTH);
add(pinText, BorderLayout.CENTER);
add(buttonPanel, BorderLayout.SOUTH);

quit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
System.exit(0);
}
});

pinText.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event)
6
char[] pinGuess = pinText.getPassword(); String pinString =
new String(pinGuess); if (pinString.equals(pin)) {
JOptionPane.showMessageDialog(null, "That pin is correct! Opening Account...");
dispose();
new ATM();
} else {
if (attempts != 1) {
attempts--;
JOptionPane.showMessageDialog(null,
"That pin is incorrect! \n" + attempts + " attempts remaining!");
} else {
JOptionPane.showMessageDialog(null, "No Attempts remaining! \n Closing Program");
System.exit(0);
}
}
}
});

entPin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
char[] pinGuess = pinText.getPassword();
String pinString = new String(pinGuess);
if (pinString.equals(pin)) {
JOptionPane.showMessageDialog(null, "That pin is correct! Opening Account...");
dispose();
new ATM();
} else {
if (attempts != 1) {
attempts--;
JOptionPane.showMessageDialog(null,
"That pin is incorrect! \n" + attempts + " attempts remaining!");
} else {
JOptionPane.showMessageDialog(null, "No Attempts remaining! \n Closing Program");
System.exit(0);
}
}
}
});
}
}

public class ATM extends JFrame {

int balance = 10;


String[] inputSequence = new String[4];
ArrayList<String> transactionHist = new ArrayList<>();
int inputSequenceIndex = 0;
int transactionIndex = 0;
boolean readyToEnter = false;

public ATM() {
super("ATM");
for (int i = 0; i <= 3; i++) {
7
inputSequence[i] = "";

}
setResizable(false);
setLocationRelativeTo(null);
buildApp();
pack();
setSize(600, 350);
setVisible(true);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}

protected void buildApp() {

JLabel displayArea = new JLabel("<html>Instruction Area: <br> Please select a function from the buttons
below <br> Current Balance: ₹"
+ balance + "</html>");
displayArea.setOpaque(true);
displayArea.setBackground(Color.white);
displayArea.setPreferredSize(new Dimension(100, 100));
JPanel bottomArea = new JPanel();
bottomArea.setLayout(new BorderLayout(0, 0));
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new BorderLayout(0, 0));
JLabel inputDisplay = new JLabel("Input Area:");
inputDisplay.setBorder(BorderFactory.createLineBorder(Color.black));
bottomArea.add(inputDisplay, BorderLayout.NORTH);

GridBagLayout buttonGrid = new GridBagLayout();


buttonPanel.setLayout(buttonGrid);
GridBagConstraints bPConst = new GridBagConstraints();

bPConst.weightx = 0.1;
bPConst.weighty = 0.1;
JButton withDraw1 = new JButton("Withdraw ₹500");
bPConst.gridx = 0;
bPConst.gridy = 0;
bPConst.insets = new Insets(0, 0, 5, 5);
withDraw1.setSize(new Dimension(200, 30));
buttonPanel.add(withDraw1, bPConst);
JButton withDraw2 = new JButton("Withdraw ₹1000");
bPConst.gridx = 0;
bPConst.gridy = 1;
withDraw2.setSize(new Dimension(200, 30));
buttonPanel.add(withDraw2, bPConst);
JButton withDraw3 = new JButton("Withdraw ₹2000");
bPConst.gridx = 0;
bPConst.gridy = 2;
withDraw3.setSize(new Dimension(200, 30));
buttonPanel.add(withDraw3, bPConst);
JButton deposit = new JButton("Deposit");
bPConst.gridx = 0;
bPConst.gridy = 3;
deposit.setSize(new Dimension(200, 30));
8
buttonPanel.add(deposit, bPConst);
JButton quit = new JButton("Quit");
bPConst.gridx = 0;

bPConst.gridy = 4;
bPConst.anchor = GridBagConstraints.PAGE_END;
quit.setSize(new Dimension(200, 30));
buttonPanel.add(quit, bPConst);
JButton number1 = new JButton("1");
bPConst.gridx = 1;
bPConst.gridy = 0;
number1.setSize(new Dimension(200, 30));
buttonPanel.add(number1, bPConst);
JButton number2 = new JButton("2");
bPConst.gridx = 2;
bPConst.gridy = 0;
number2.setSize(new Dimension(200, 30));
buttonPanel.add(number2, bPConst);
JButton number3 = new JButton("3");
bPConst.gridx = 3;
bPConst.gridy = 0;
number3.setSize(new Dimension(200, 30));
buttonPanel.add(number3, bPConst);
JButton number4 = new JButton("4");
bPConst.gridx = 1;
bPConst.gridy = 1;
number4.setSize(new Dimension(200, 30));
buttonPanel.add(number4, bPConst);
JButton number5 = new JButton("5");
bPConst.gridx = 2;
bPConst.gridy = 1;
number5.setSize(new Dimension(200, 30));
buttonPanel.add(number5, bPConst);
JButton number6 = new JButton("6");
bPConst.gridx = 3;
bPConst.gridy = 1;
number6.setSize(new Dimension(200, 30));
buttonPanel.add(number6, bPConst);
JButton number7 = new JButton("7");
bPConst.gridx = 1;
bPConst.gridy = 2;
number7.setSize(new Dimension(200, 30));
buttonPanel.add(number7, bPConst);
JButton number8 = new JButton("8");
bPConst.gridx = 2;
bPConst.gridy = 2;
number8.setSize(new Dimension(200, 30));
buttonPanel.add(number8, bPConst);
JButton number9 = new JButton("9");
bPConst.gridx = 3;
bPConst.gridy = 2;
number9.setSize(new Dimension(200, 30));
buttonPanel.add(number9, bPConst);
JButton number0 = new JButton("0");
9
bPConst.gridx = 1;
bPConst.gridy = 3;
number0.setSize(new Dimension(200, 30));

buttonPanel.add(number0, bPConst);
JButton clear = new JButton("Clear");

bPConst.gridx = 2;
bPConst.gridy = 3;
clear.setSize(new Dimension(200, 30));
buttonPanel.add(clear, bPConst);
JButton enter = new JButton("Enter");
bPConst.gridx = 3;
bPConst.gridy = 3;
enter.setSize(new Dimension(200, 30));
buttonPanel.add(enter, bPConst);
bottomArea.add(buttonPanel, BorderLayout.CENTER);
add(displayArea, BorderLayout.NORTH);
add(bottomArea, BorderLayout.CENTER);

withDraw1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (balance >= 500) {
balance = balance - 500;
displayArea.setText("<html>₹500 Withdrawn! <br><br>" + finishedTransaction() + "</html>");
readyToEnter = false;
System.out.println("User Has Withdrawn ₹500");
updateTransactionHist("User Has Withdrawn ₹500");
} else {
displayArea.setText("<html> Your Balance is below ₹500. Unable to Withdraw!! <br><br>"
+ finishedTransaction() + "</html>");
}
}
});
withDraw2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (balance >= 1000) {
balance = balance - 1000;
displayArea.setText("<html>₹1000 Withdrawn! <br><br>" + finishedTransaction() + "</html>");
readyToEnter = false;
System.out.println("User Has Withdrawn ₹1000");
updateTransactionHist("User Has Withdrawn ₹1000");
} else {
displayArea.setText("<html> Your Balance is below ₹1000. Unable to Withdraw!! <br><br>"
+ finishedTransaction() + "</html>");
}

}
});
withDraw3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (balance >= 2000) {
balance = balance - 2000;
displayArea.setText("<html>₹2000 Withdrawn! <br><br>" + finishedTransaction() + "</html>");
10
readyToEnter = false;
System.out.println("User Has Withdrawn ₹2000");
updateTransactionHist("User Has Withdrawn ₹2000");
} else {
displayArea.setText("<html> Your Balance is below ₹2000. Unable to Withdraw!! <br><br>"
+ finishedTransaction() + "</html>");

quit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
JOptionPane.showMessageDialog(null, "Your Receipt: \n" + printReceipt());
JOptionPane.showMessageDialog(null, "Logging Out! Returning to Login Screen!");
dispose();
new Login();
}
});
clear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: ");
displayArea.setText("<html>Input Area Cleared! <br><br>" + finishedTransaction() + "</html>");
clearInput();
readyToEnter = false;
}
});
number1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("1"));
}
});
number2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("2"));
}
});
number3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("3"));
}
});
number4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("4"));
}
});
number5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("5"));
}
});
number6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("6"));
}
});
number7.addActionListener(new ActionListener() {
11
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("7"));
}
});
number8.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {

});
inputDisplay.setText("Input Display: " + updateInput("8"));

}
});
number9.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("9"));
}
});
number0.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
inputDisplay.setText("Input Display: " + updateInput("0"));
}
});
deposit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
displayArea.setText("<html> Deposit Selected! <br> Please input an amount below or equal to
₹10000 and click enter! <br><br>"
+ finishedTransaction() + "</html>");
readyToEnter = true;
}
});
enter.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (readyToEnter == true) {
if (Integer.parseInt(getInputSequence()) > 10000) {
displayArea.setText("That input is greater than ₹10000!");
clearInput();
inputDisplay.setText("Input Display: ");
readyToEnter = false;
} else if (Integer.parseInt(getInputSequence()) == 0 || getInputSequence().equals("0000")) {
displayArea.setText("You have not entered a value!");
clearInput();
inputDisplay.setText("Input Display: ");
readyToEnter = false;
} else {
updateBalance(Integer.parseInt(getInputSequence()));
displayArea.setText("<html>You have deposited ₹" + getInputSequence()
+ "! <br><br>" + finishedTransaction() + "</html>");
System.out.println("User Has Deposited ₹" + getInputSequence());
updateTransactionHist("User Has Deposited ₹" + getInputSequence());
}
clearInput();
inputDisplay.setText("Input Display: ");
readyToEnter = false;

12
} else {
displayArea.setText("<html>You have not yet chosen an action! <br><br>" +
finishedTransaction() + "</html>");
clearInput();
inputDisplay.setText("Input Display: ");
}

}
});
}

void clearInput() {

}
inputSequenceIndex = 0;
}

String updateInput(String n) {
if (inputSequenceIndex <= 3) {
inputSequence[inputSequenceIndex] = n;
inputSequenceIndex++;

StringBuilder strBuilder = new StringBuilder();


for (int i = 0; i < inputSequence.length; i++) {
strBuilder.append(inputSequence[i]);
}
String newString = strBuilder.toString();
return newString;
} else {
StringBuilder strBuilder = new StringBuilder();
for (int i = 0; i <= 3; i++) {
strBuilder.append(inputSequence[i]);
}
String newString = strBuilder.toString();
return newString;
}
}

String getInputSequence() {
StringBuilder strBuilder = new StringBuilder();
if (inputSequence[0].equals("")) {
return "0000";
} else {
for (int i = 0; i < inputSequence.length; i++) {
strBuilder.append(inputSequence[i]);
}
String newString = strBuilder.toString();
return newString;
}
}

String finishedTransaction() {
return "Instruction Area: <br> Please select a function from the buttons below <br> Current Balance: ₹" +
13
balance;
}

void updateBalance(int l) {
balance += l;
}

void updateTransactionHist(String t) {
transactionHist.add(t);
}

String printReceipt() {

for (int i = 0; i <= 3; inputSequence[i] = return "No Transactions Made!";


} else {
StringBuilder strBuilder = new StringBuilder();
for (String transaction : transactionHist) {
strBuilder.append(transaction).append("\n");
}
return strBuilder.toString();
}
}

public static void main(String[] args) {


new Login();
}
}

14
7. SYSTEM TESTING

7.1 Test Case 1 – Logging In

Input:
Please Enter the pin - 1234
** pin – 1234 **

Expected Output :

You have logged in successfully.

7.2 Test Case 2 – Withdrawing 500

Input:
Instruction Area:
Please select a function from the buttons below
Current Balance: ₹10
*Pressed withdraw 500 button*

` Expected Output:

Your Balance is below 500!!. Unable to withdraw

Instruction Area:
Please select a function from the buttons below
Current Balance: ₹10

7.3 Test Case 3 – Depositing 5000

Input:

Instruction Area:
Please select a function from the buttons below
Current Balance: ₹10
*Pressed Deposit button*

Expected Output:

Deposit Selected!!.
Please enter an amount of upto 10000₹ and click enter.
Input Display: 5000
** Click Enter **
15
You have Deposied
₹5000!!
Instruction Area:
Please select a function from the buttons below
Current Balance: ₹5010

7.4 Test Case 4 – Withdrawing 2000


Input:
Instruction Area:
Please select a function from the buttons below
Current Balance: ₹5010
*Pressed withdraw 500 button*

` Expected Output:

Withdrawn 2000₹ successfully.

Instruction Area:
Please select a function from the buttons below
Current Balance: ₹3010

16
8. OUTPUT SCREENS

8.1 – Screen

8.2 – Screen

17
8.3 – Screen

8.4 - Screen

18
9. CONCLUSION

In conclusion, the provided JAVA code The provided Java code presents a simple yet effective simulation
of an Automated Teller Machine (ATM) system through two main classes: `Login` and `ATM`. The
`Login` class governs the secure login process, where users are required to enter a Personal Identification
Number (PIN). A limited number of attempts are allowed, and successful authentication leads to the opening
of the ATM screen, managed by the `ATM` class. The `ATM` class encapsulates various ATM
functionalities within a graphical user interface (GUI). Users can perform actions such as balance inquiry,
cash withdrawal with varying amounts, and fund deposits. The interface is designed with intuitive buttons,
contributing to a user-friendly experience. Input validation mechanisms are in place to handle scenarios like
insufficient funds or incorrect PIN entries. The system keeps track of user activities by maintaining a
transaction history. Users have the option to generate a receipt, providing a comprehensive overview of their
recent transactions upon choosing to quit the session. The code's structure reflects a modular approach with
two distinct classes, promoting readability and ease of maintenance

19
10. FUTURE ENHANCEMENTS

1. Multi-User Support:
- Implement a user account system, allowing multiple users to have personalized accounts with
unique PINs and balances.

- Introduce a user authentication mechanism to switch between accounts securely.

2. Transaction Categorization:
-Classify transactions into categories (e.g., withdrawals, deposits) for a more organized transaction
history.
-Enable users to view transaction history based on categories.

3. Overdraft Protection:
- Introduce an overdraft protection feature to prevent users from overdrawing their account balances.
- Notify users of low balances and provide options to transfer funds or take necessary actions.

4. Transaction Limits:
- Set transaction limits for withdrawals and deposits to enhance security and prevent fraudulent
activities.
- Allow users to customize their transaction limits within permissible bounds.

5. Currency Handling:
- Extend the system to handle multiple currencies, providing international users with a more
versatile experience.
- Implement currency conversion functionalities for cross-currency transactions.

20
11. REFERENCES

1. https://docs.oracle.com/en/java/

2. https://www.javatpoint.com/java-swing

3. https://www.geeksforgeeks.org/java/

4. https://www.tutorialspoint.com/swing/swing_quick_guide.htm

5. https://www.geeksforgeeks.org/java/

6. https://www.java.com/en/

7. https://github.com/topics/java-project

8. https://github.com/topics/java-project

9. https://www.tutorialspoint.com/java/index.htm

10. https://www.codechef.com/roadmap/java-dsa

21

You might also like