Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ATM Machine Simulator using

Finite-State Automata

Project Report

Submitted By-Akul Chanana 2K21CSUN01007


Anjali Singh 2K21CSUN01010
Bibin B George 2K21CSUN01015
Introduction
This project report describes the design and implementation of a basic ATM
machine simulator using the concepts of finite-state automata (DFA). The
simulator replicates core functionalities like card insertion (simulated by account
number selection), PIN verification, transaction selection (withdrawal and balance
check), cash dispensing (simulated message), and error handling.

System Overview
The ATM simulator is modeled as a DFA with various states representing different
stages of user interaction. The user provides input through the console, and the
program transitions between states based on the input and predefined
conditions.

States:

 S0: Initial state (no card)


 S1: Card inserted (account number entered), waiting for PIN
 S2: Valid PIN entered, transaction selection
 S3: Transaction selected (optional, for future enhancements)
 S4: Enter amount (for withdrawal)
 S5 (Optional): Insufficient funds
 S6: Cash dispensed (simulated message), transaction complete
 S7: Card ejected (simulated message), machine idle

Inputs:

 Enter account number (A)


 Enter PIN (P)
 Correct PIN (Y) - Verified against user data
 Incorrect PIN (N)
 Select transaction (T) - Currently offers withdrawal (W) and balance check
(B)
 Enter amount (for withdrawal) (E)
 Sufficient funds (F)
 Insufficient funds (I)
 Dispense cash (D) (simulated message)
 Eject card (E) (simulated message)

System Design
The system design leverages the DFA model to control the ATM's behavior. The C
code implements the state transitions and associated actions based on user input.

 State transitions: The code defines a switch statement that evaluates the
current state and reacts to user input by transitioning to the next state or
handling errors.
 Actions: Each state performs specific actions like prompting for PIN,
validating PIN, processing transactions (withdrawal reduces balance,
balance check displays current balance), displaying messages (simulated
cash dispense and card eject), and handling user choices.

Implementation
The C code implements the ATM functionalities as described. Key aspects include:

 PIN verification: Implemented using user data stored in the program


(replace with secure methods like reading encrypted data from a file for
real-world applications).
 Transaction selection: A simplified approach demonstrates withdrawal and
balance checking (can be extended for deposit, mini-statement printing,
and account transfer in future enhancements).
 Error handling: The code handles invalid inputs (account number, PIN,
transaction selection) and guides the user through the process (insufficient
funds for withdrawal).
 User choices: The code allows users to choose further transactions after a
successful login and confirm program exit before leaving the initial state.
Results and Discussion
The implemented ATM simulator successfully demonstrates basic functionalities
using a finite-state automata approach. It provides a foundation for
understanding how automata theory can be applied to model and simulate real-
world systems.

Future Enhancements
The ATM simulator can be further improved by incorporating:

 Security measures: Implement stronger PIN verification methods


(encryption, hashing), card blocking after multiple failed attempts, and
secure data storage (encrypted files).
 Additional functionalities: Include features like deposit, mini-statement
printing, account transfer, and bill payments.
 User interface: Develop a more user-friendly interface using a graphical
user interface (GUI) library.

Conclusion
This project successfully designed and implemented a basic ATM machine
simulator using finite-state automata. The project demonstrates the practical
application of automata theory in system modeling and simulation. With further
enhancements, the simulator can become a more comprehensive tool for
educational purposes or as a base for developing real ATM systems.

You might also like