0% found this document useful (0 votes)
29 views32 pages

Project File PDF

Uploaded by

stanrabyang01
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)
29 views32 pages

Project File PDF

Uploaded by

stanrabyang01
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/ 32

National Institute of Electronics & Information

Technology

Project : Python
[Virtual ATM Simulator]
Submitted in the partial fulfillment of the requirements for
the award of Certified O - Level Course

_Session : 2024 - 2025__

Submitted to: - Submitted by Name (regimental number)

Er. Poonam Rana Stanzin Rabyang (1653213)


Stanzin Phantok (1653160)
Tsewang Dorjay (1653216)
NIELIT CHD
Ghulam Hussain (1653179)

1
_CONTENTS__

S.No TOPICS Page


No
1 Acknowledgement 3
2 Declaration 4
3 About NIELIT 5
4 About Python 8
6 About Project 14
7 Objectives of the Project 15
8 Implementation of the Project 17
9 Project’s Code 20
10 Steps of Output Execution with 25
Snap-shot
11 Conclusion 31

2
_ACKNOWLEDGEMENT_

The successful completion of this project could


not have been possible without the help &
guidance of many people. We take this
opportunity to express our sincere thanks & deep
gratitude to all those people who extended their
whole hearted co-operation and helped us in
completing this project successfully.

In particular, we are grateful to Mrs. Poonam


Rana who steered us through her experience to
undertake and accomplish this project. We thank
our guide who has been a source of inspiration &
knowledge for us throughout the completion of
the project. Her support for us was invaluable
during the period we were working on this
project.

Thanking You

3
_DECLARATION__
We hereby declare the work presented by us in this
project, entitled “Virtual ATM Simulator” partial
fulfillment of requirement for ‘O-Level Course’, and
submitted at “NIELIT Chandigarh” is an authentic piece
of our own work carried out under the supervision of
Mrs. Er. Poonam Rana.

Submitted by: -

Course(O – Level)_
Stanzin Rabyang (1653213)
Stanzin Phantok (1653160)
Tsewang Dorjay (1653216)
Ghulam Hussain (1653179)

4
_ABOUT NIELIT__

Introduction to NIELIT
National Institute of Electronics and Information Technology (NIELIT),
formerly known as the DOEACC Society, an Autonomous Scientific Society
under the administrative control of Ministry of Electronics & Information
Technology (Moe & IT), Government of India, was set up to carry out Human
Resource Development and related activities in the area of Information,
Electronics & Communications Technology (IECT). NIELIT is engaged both in
Formal & Non-Formal Education in the area of IECT besides development of
industryoriented quality education and training programmes in the state-of-
the-art areas. NIELIT has endeavoured to establish standards to be the
country’s premier institution for Examination and Certification in the field of
IECT. It is also one of the National Examination Body, which accredits
institutes/organizations for conducting courses in IT in the non-formal sector.

5
NIELIT Centres Across India
As on date, IELIT has forty seven (47) centers located at Agartala, Aizawl,
Ajmer, Alawalpur (Saksharta Kendra), Aurangabad, Bhubaneswar, Calicut,
Chandigarh, Chennai, Chuchuyimlang, Churachandpur, Daman, Delhi,
Dibrugarh, Dimapur, Gangtok, Gorakhpur, Guwahati, Haridwar, Imphal,
Itanagar, Jammu, Jorhat, Kargil, Kohima, Kolkata, Kokrajhar, Kurukshetra,
Lakhanpur (Saksharta Kendra), Leh, Lucknow, Lunglei, Majuli, Mandi,
Pasighat, Patna, Pali, Ranchi, Ropar, Senapati, Shillong, Shimla, Silchar,
Srinagar, Tezpur, Tura and Tezu with its Headquarters at New Delhi. It is also
well networked throughout India with the presence of about 700 + institutes.

Expertise in IT Training
Over the last two decades, NIELIT has acquired very good expertise in IT
training, through its wide repertoire of causes, ranging from ‘O’ Level
(Foundation), ‘A’ Level (Advance Diploma), ‘B’ Level (MCA equivalent), ‘C’
Level (M-Tech level), IT literacy courses such as CCC (Course on Computer
Concept), BCC (Basic Computer Course) and other such long term and short
term course in the non formal sector like courses on Information Security, ITeS-
BPO(Customer Care/Banking), Computer Hardware Maintenance (CHM-O/A
level), Bio-Informatics(BI-O/A/B level), ESDM etc, besides, high end courses
offered by NIELIT Centres at Post-Graduate level (M.Tech) in Electronics
Design & Technology, Embedded Systems etc. which are not normally offered
by Universities/Institutions in the formal sector, in association with the
respective state Universities.

Projects and Capabilities of NIELIT


The basket of activities of NIELIT is further augmented by the wide range of
projects that it undertakes. NIELIT has demonstrated its capability and capacity
to undertake R&D projects, consultancy services, turnkey projects in office
automation, software development, website development etc. NIELIT is also

6
the nodal implementing agency on behalf of MeitY for Data Digitization of the
population of 15 assigned States and 2 Union Territories for the creation of
National Population Register (NPR) project of Registrar General of India (RGI).

Agriculture Census and Input Survey Project


NIELIT is also successfully executing the Agriculture Census and Input Survey
project under which tabulation of about 10 crore data records have to be done.
NIELIT has planned a roadmap for adopting appropriate pedagogy for
metamorphosing NIELIT into an Institute of National Importance.

NIELIT Chandigarh Overview


NIELIT, Chandigarh was formed in 1978 to impart professional training in the
domain of Electronics & Communication and Information Technology (IECT).
It is an autonomous body of Ministry of Electronics and Information
Technology, Government of India. It has been an area of interest of this Centre
to excel in various areas of Information, Electronics & Communication
Technology. This centre is ISO 9001-2008 certified. This is an IT and Electronics
Organization with crystal` clear strategies and operations that aims to provide
its customers a complete package of IT Solutions and products. The Centre
ensure cost effective, time to market solutions through a highly skilled work
force driven by strong design principles, highest levels of qualities and ethical
business practices and constantly strive to delight our customers through
excellence in Service Delivery. The Centre aims to disseminate knowledge on
all aspects to the utmost user satisfaction and has specialized services to
different segments of clients based on requirements assessed from time to
time.

7
_ABOUT PYTHON__

_Introduction__
Python is a high-level, interpreted
programming language known for its
simplicity and readability. It was created
by Guido van Rossum and released in
1991. Python emphasizes code
readability, allowing developers to
express concepts in fewer lines of code
compared to other programming
languages.

Features
• Readable and Clean Syntax: Python uses indentation to define code
blocks, which makes the code easy to read and understand.
• Dynamic Typing: Python is dynamically typed, meaning you don't
need to declare the type of a variable before using it.
• Interpreted Language: Python is an interpreted language, meaning
that code is executed line-by-line. This makes it easier to test and
debug.
• Extensive Standard Library: Python comes with a comprehensive
standard library that includes modules for file I/O, regular
expressions, networking, web development, and more.

8
• Cross-platform Compatibility: Python runs on various platforms,
including Windows, Linux, and macOS.
• Support for Multiple Paradigms: Python supports procedural,
object-oriented, and functional programming styles, making it
flexible for different kinds of projects.
• Large Community and Ecosystem: Python has a vast community
and a wealth of third-party libraries and frameworks (like Django
for web development, Pandas for data analysis, and TensorFlow for
machine learning).
• Popular for Various Applications: Python is widely used in web
development, data analysis, scientific computing, machine learning,
automation, and scripting

Here is an example of a basic Python program:

Python

# This is a comment
def greet(name):
print(f"Hello, {name}!")

greet("Alice")

This code defines a function greet() that takes a name as an argument and
prints a greeting message. When you call greet("Alice"), it prints "Hello,
Alice!".
Python's simplicity and readability make it a popular choice for beginners and
experienced developers alike.

9
Python's Versatility

Python’s flexibility is one of its key strengths. It can be used for a wide range of
applications, such as:
• Web Development: Build server-side applications using frameworks like
Django or Flask.
• Data Analysis & Visualization: With libraries like Pandas and Matplotlib,
Python is a favorite among data analysts and scientists.
• Automation and Scripting: Python’s clean syntax makes it ideal for
writing automation scripts to handle repetitive tasks.
• Machine Learning & AI: Python is the most popular language for
machine learning, thanks to libraries like TensorFlow, Keras, and Scikit-
learn.

• Game Development: Python can be used to create games, typically with


libraries like Pygame.

How Python Works (Execution Flow)


Python is executed in the following way:
1. Code is written in a .py file.
2. Python interpreter reads the code line by line, converting it into
bytecode.
3. Bytecode is executed by the Python runtime.

10
Why is Python Popular?

• Simplicity: Python’s clean, readable syntax makes it easy to learn and


use, especially for beginners.
• Wide Adoption: Python is used by companies like Google, Facebook, and
NASA for different types of software development.
• Strong Community: With a large user base, you can find tutorials,
forums, and help easily when learning Python.

Python’s Popular Libraries and Frameworks

In addition to the standard library, Python has a vast ecosystem of third-party


libraries and frameworks that extend its functionality. These libraries can help
you work in a wide variety of fields:
• Web Development: Django, Flask
• GUI Development : Tkinter, PyQt, Kivy

• Data Science & Machine Learning: Pandas, NumPy, Matplotlib,


TensorFlow, Scikit-learn
• Game Development: Pygame
• Automation: Selenium, PyAutoGUI
• Networking: Twisted, socket

These libraries make Python a powerful tool for almost any project.

11
_Python Overview in
Tabular Form___
Main Idea Explanation Examples Key Terms
Containers for storing data Variable, Assignment
Variables x = 10; name = 'Alice'
values. Operator, Data Types

Classification of data into Integer, Float, String,


Data Types int, float, str, bool, list
specific categories. Boolean, List

Symbols used to perform Arithmetic,


Operators operations on variables and +, -, *, /, %, ==, != Comparison, Logical
values. Operators

Conditional Execute code based on if x > 10:


if, elif, else
Statements specific conditions. print('Greater')

Repeat a block of code for, while, break,


Loops for i in range(5): print(i)
multiple times. continue

Blocks of reusable code that def greet(name): return Function, Parameter,


Functions
perform specific tasks. 'Hello ' + name Return, Argument

Ordered, mutable collection List, Index, Append,


Lists numbers = [1, 2, 3, 4]
of items. Pop, Slice

Ordered, immutable Tuple, Immutable,


Tuples point = (1, 2)
collection of items. Index

Unordered, mutable Dictionary, Key-Value


student = {'name':
Dictionaries collection of key-value Pair, Items, Keys,
'Alice', 'age': 20}
pairs. Values

Unordered collection of fruits = {'apple', Set, Unique, Add,


Sets
unique items. 'banana', 'orange'} Remove

12
Main Idea Explanation Examples Key Terms
Pre-written code collections Module, Library,
Modules and import math;
that provide additional Import, Built-in,
Libraries print(math.sqrt(16))
functionality. External

with open('file.txt', 'r') File, Open, Read, Write,


File Handling Reading and writing files.
as file: print(file.read()) Close

try: x = 1/0 except


Exception Managing errors during Try, Except, Finally,
ZeroDivisionError:
Handling program execution. Raise
print('Error')

Object-
Oriented Organizing code using class Dog: def Class, Object, Method,
Programming objects and classes. bark(self): print('Woof') Attribute, Inheritance
(OOP)

List
squares = [x**2 for x in List Comprehension,
Comprehensio Concise way to create lists.
range(5)] Expression, Iteration
ns

Lambda Anonymous functions square = lambda x: x ** Lambda, Anonymous,


Functions defined in a single line. 2; print(square(4)) Function

Regular
Pattern matching and text import re; re.match(r'\ Regex, Match, Search,
Expressions
searching tools. d+', '123') Pattern, Compile
(Regex)

Conclusion
Python is an excellent choice for anyone learning programming due to its
simple syntax, powerful capabilities, and vast range of applications. Whether
you're interested in web development, data science, automation, or artificial
intelligence, Python provides the tools and resources you need to succeed. The
combination of readability, flexibility, and a large supportive community makes
Python one of the best programming languages to learn and use .

13
__ABOUT PROJECT__

Virtual ATM Simulator

Introduction

The Virtual ATM Simulator is a Python-based


project designed to replicate the functionality
of an Automated Teller Machine (ATM). It
allows users to perform common banking
operations, such as balance inquiries, cash
withdrawals, deposits, and PIN management,
in a secure environment. The project leverages
object-oriented programming (OOP) principles,
including classes, objects, and encapsulation,
to model real-world ATM operations effectively.
This simulator not only serves as a practical
example of Python programming but also
provides a hands-on approach for learners to understand the implementation of
financial systems. The project emphasizes security features, such as PIN verification
and limited attempts, to prevent unauthorized access.
This documentation outlines the objectives, features, design details, implementation
steps, and potential future improvements for the Virtual ATM Simulator project.

14
_Objectives of Project___

The Virtual ATM Simulator aims to replicate the functionality of an Automated


Teller Machine (ATM) in a virtual environment. Its primary objectives include:
1. Simulating Real-World ATM Features:
• Provide users with core ATM functionalities, such as balance
inquiry, withdrawals, deposits, and PIN management.
• Create an interactive experience that mimics real banking
scenarios.
2. Enhancing Financial Literacy:
• Help users understand ATM operations and financial transactions
in a simulated and safe environment.
• Provide a hands-on learning tool for beginners exploring banking
systems and programming concepts.
3. Implementing Secure Authentication:
• Ensure user data protection by incorporating PIN-based
authentication.
• Introduce a mechanism for limited attempts to prevent
unauthorized access, enhancing system security.
4. Showcasing Object-Oriented Programming (OOP):
• Demonstrate the application of OOP principles in Python.
• Implement encapsulation, data hiding, and modular design for
better code organization and reusability.

15
5. Promoting Expandability and Modularity:
• Provide a framework that can be easily extended to include
advanced features, such as transaction history and fund transfers.
• Enable seamless integration with databases or APIs for real-time
operations in the future.

Features
• Account Authentication: Secure PIN verification with up to 3 attempts
before locking the account.
• Balance Enquiry: Displays the account balance to the user.
• Withdraw Funds: Allows withdrawals while ensuring the balance
remains sufficient.
• Deposit Funds: Enables deposits into the user’s account.
• PIN Change: Allows users to update their PIN securely.
• PIN Generation: Generates a new random PIN for the user if required.
• Error Handling: Manages errors, such as invalid input or insufficient
funds, gracefully.
• Object-Oriented Design: Uses classes and methods to promote modular
and reusable code.
• Scalability: The code structure supports future extensions and
enhancements.

16
_Implementation of Project__
Technologies Used:
• Programming Language: Python 3.x
• Environment: Any Python-supported IDE or text editor (e.g., PyCharm,
Visual Studio Code, or IDLE).

Class Design

Class: Client

Purpose: Represents a bank client and manages account details and PIN
security.

Attributes:
• insti_name: Class-level attribute representing the institute name.
• acc_no: Unique account number assigned to each client.
• __pin: Private attribute for PIN storage to ensure security.
• bal: Stores the account balance.
• name: Name of the client.
• gender: Gender of the client.
• address: Address of the client.
• pin_attempts: Tracks the number of PIN attempts remaining before
the account is locked.

Methods:
• Constructor: Initializes all attributes for each client instance.
Functions

17
verify_pin(client, pin)

• Verifies if the entered PIN matches the client’s stored PIN.


• Resets PIN attempts on success and reduces attempts on failure.
• Locks the account after 3 consecutive failures.
balance_enquiry(client)

• Displays the current balance in the client’s account.


withdraw(client, amount)

• Checks if sufficient funds are available before withdrawing the specified


amount.
• Updates the balance after a successful transaction.
deposit(client, amount)

• Accepts a specified amount and adds it to the client’s balance.


change_pin(client, new_pin)

• Updates the client’s PIN securely.


generate_pin(client)

• Generates and assigns a random 4-digit PIN.

Steps to Execute the Program


1. Install Python 3.x if not already available.
2. Save the source code in a Python file (e.g., atm_simulator.py).
3. Open the terminal or command prompt and navigate to the file location.
4. Execute the program using the command:
python atm_simulator.py

18
5. Enter the account number when prompted.
6. Authenticate using the PIN.
7. Select an operation (e.g., balance enquiry, withdrawal, deposit, etc.)
based on the on-screen menu.

Limitations
• No Database Integration: User data is hard-coded into the program,
limiting scalability and real-world applicability.
• Lack of GUI: Operates solely through the command line, making it less
user-friendly compared to graphical interfaces.

• No Transaction History: Does not maintain a log of past transactions for


auditing or review.
• No Networking Support: Designed for offline use, limiting integration
with online banking systems.

Future Enhancements
• Database Integration: Connect the system to a database for dynamic
storage and retrieval of account data.
• Graphical Interface: Implement a GUI for a more user-friendly
experience.
• Transaction Logs: Maintain a record of all transactions for
accountability.

19
• Multi-User Support: Enable multiple simultaneous users to interact with
the system.
• Online Access: Incorporate web-based features for remote access.
• Security Upgrades: Implement encryption techniques to secure sensitive
data.

_Project Code__

print(" Welcome to Future Bank\n")

# PIN Verification

def verify_pin(client, pin):

if client.pin_attempts > 0:

if client._Client__pin == pin:

client.pin_attempts = 3 # Reset attempts on success

return True

else:

client.pin_attempts -= 1

print(f"Incorrect PIN. Attempts remaining: {client.pin_attempts}")

return False

20
else:

print("Account locked due to too many incorrect attempts.")

return False

# Balance Enquiry

def balance_enquiry(client):

print(f"Your current balance is: ₹{client.bal}")

# Withdrawal

def withdraw(client, amount):

if amount > client.bal:

print("Insufficient balance!")

else:

client.bal -= amount

print(f"₹{amount} withdrawn. New balance: ₹{client.bal}")

# PIN Change

def change_pin(client, new_pin):

client._Client__pin = new_pin

print("PIN changed successfully!")

# PIN Generation

21
def generate_pin(client):

import random

new_pin = random.randint(1000, 9999)

client._Client__pin = new_pin

print(f"Your new PIN is: {new_pin}")

class Client:

insti_name = "Nielit CHD" # Class attribute

def __init__(self, acc_no, pin, bal, name, gender, address): # Constructor

self.acc_no = acc_no

self.__pin = pin # Private attribute for PIN

self.bal = bal # Object attributes

self.name = name

self.gender = gender

self.address = address

self.pin_attempts = 3 # Maximum PIN attempts

# Creating client objects

user_1 = Client(1001, 1234, 72000, "Rukia Kuchiki", 'F', "Ladakh")

user_2 = Client(1002, 2345, 89000, "Eren Yeager", 'M', "Arunachal")

user_3 = Client(1003, 3456, 65000, "Momo Ayese", 'F', "Himachal")

22
user_4 = Client(1004, 4567, 54000, "Tenzin Yangrab", "M", "Zangkar")

user_5 = Client(1005, 5678, 95000, "Mikasa Acremen", 'F', "Ngari")

# Adding clients to a list

lis = [user_1, user_2, user_3, user_4, user_5]

# User interaction

inp = int(input("Enter Your Account Number: ")) # Convert to integer

for client in lis:

if inp == client.acc_no: # Check if account number matches

while client.pin_attempts > 0:

pin_var = int(input("Enter Your PIN: ")) # Convert to integer

if verify_pin(client, pin_var): # Check if PIN matches

print("Login Successful!")

print("\nPress: 1 --> Balance Enquiry")

print("Press: 2 --> Withdrawal")

print("Press: 3 --> PIN Change")

print("Press: 4 --> PIN Generation")

ope = int(input("What do you want to do: ")) # Convert to integer

if ope == 1: # Balance Enquiry

balance_enquiry(client)

23
elif ope == 2: # Withdrawal

amt = int(input("Enter the amount to withdraw: "))

withdraw(client, amt)

elif ope == 3: # PIN Change

new_pin = int(input("Enter your new PIN: "))

change_pin(client, new_pin)

elif ope == 4: # PIN Generation

generate_pin(client)

else:

print("Invalid option selected.")

break

else:

if client.pin_attempts == 0:

print("Account locked. Please contact customer service.")

break

break

else:

print("Account number not found.")

24
_Steps of Output Execution__
_with Snapshot__
1. Welcome Message
When the program starts, it displays

2. Enter Account Number

The program prompts the user to enter their account number:

The user inputs their account number, e.g., 1001.

• It checks if the entered account number matches any client in the list
lis.
• If no match is found, it displays .

The program stops here if no match is found.

25
3. PIN Verification

If the account number matches, the program asks for the PIN:

If the PIN matches, the user logs in successfully:

If the PIN is incorrect, it shows:

After 3 incorrect attempts, it locks the account:

The program stops here if PIN verification fails.

26
4. Menu Options

Once logged in, the user sees:

The user selects an operation by entering a number (1-5).

5. Operations

Option 1: Balance Enquiry

• Displays the current balance:

27
Option 2: Withdrawal

• Asks the user for the amount to withdraw

If successful

If funds are insufficient:

28
Option 3: Deposit

• Asks the user for the amount to deposit:

• Updates balance and displays:

Option 4: PIN Change

• Prompts for a new PIN:

• Confirms change:

29
Option 5: PIN Generation

• Generates a random PIN:

6. Invalid Option

If the user selects an option other than 1–5, it displays:

7. Program Ends

After completing an operation, the program ends unless restarted manually

30
_Conclusion___
The Virtual ATM Simulator successfully demonstrates the fundamental
operations of an ATM in a simulated environment. It showcases essential
programming techniques, including object-oriented design, data
encapsulation, and modular code organization. While the project serves as a
practical educational tool, it also lays the groundwork for more advanced
banking applications.
This project highlights the importance of secure authentication and modular
design, providing a foundation for further development. It can be extended to
include advanced features, such as:
• Transaction History: To keep track of all user activities.

• Fund Transfers: Enabling users to send money between accounts.

• Database Integration: Allowing data persistence for a real-world simulation.

• Mobile and Web Interface: Making the simulator accessible via multiple
platforms.

By focusing on security, usability, and extensibility, the Virtual ATM Simulator


is a scalable and adaptable solution for teaching and learning purposes, as well
as for real-world prototyping of ATM systems.

Future enhancements, such as GUI integration and database connectivity, can


transform this simulator into a scalable and fully functional ATM system. This
project highlights the importance of secure coding practices and provides a
platform for exploring further developments in financial software applications.

31
32

You might also like