Professional Documents
Culture Documents
JOSEPH’’’`S SCHOOL
-INFORMATICS PRACTICE–S-
PROJECT
TOPIC : ATM MANAGEMENT SYSTEM
CERTIFICATE
………………………. .…………………..
Teacher In-Charge Principal
………………………..
External Examiner School Stamp
ST. JOSEPH SCHOOL
Azara,Guwahati,781014
ACKNOWLEDGEMENT
2. Transaction
This table is used to record transaction details:
SOURCE CODE
import mysql.connector
import pandas as pd
import matplotlib.pyplot as plt
import random
db = mysql.connector.connect(
host="sql6.freesqldatabase.com",
user="sql6630736",
password="4sCuF1UzXH",
database="sql6630736"
)
if result[0]:
return result[0] + 1
else:
return 1
pin = generate_pin()
account_number = generate_account_number()
cursor.execute(insert_query, values)
db.commit()
print("Account created successfully. Your account number is:",
account_number)
print("Your PIN is:", pin)
if cursor.rowcount == 1:
print("Account deleted successfully.")
else:
print("Account not found.")
if result:
balance, pin = result
entered_pin = input("Enter your 4-digit PIN: ")
if int(entered_pin) != pin:
print("Incorrect PIN. Withdrawal failed.")
return
print("Withdrawal successful.")
else:
print("Insufficient balance.")
else:
print("Account not found.")
if result:
balance = result[0]
new_balance = balance + amount
update_query = "UPDATE accounts SET balance = %s WHERE account_number
= %s"
cursor.execute(update_query, (new_balance, account_number))
db.commit()
print("Deposit successful.")
else:
print("Account not found.")
cursor.execute(query, (to_account,))
receiver_balance = cursor.fetchone()
print("Transfer successful.")
else:
print("Insufficient balance.")
else:
print("One or both accounts not found.")
if result:
print("Account Balance:", result[0])
else:
print("Account not found.")
if rows:
print("Account Details:")
for row in rows:
print("Account Number:", row[0])
print("Name:", row[1])
print("Address:", row[2])
print("Age:", row[3])
print("Balance:", row[4])
print("------------------------")
else:
print("No accounts found.")
# Function to plot a graph showing the total number of accounts with balance
def plot_account_balance_graph():
query = "SELECT balance FROM accounts"
cursor.execute(query)
rows = cursor.fetchall()
if rows:
balances = [row[0] for row in rows]
df = pd.DataFrame({"Balance": balances})
df.plot.hist(bins=10, edgecolor='black')
plt.xlabel("Balance")
plt.ylabel("Number of Accounts")
plt.title("Account Balance Distribution")
plt.show()
else:
print("No accounts found.")
if rows:
print("Last 5 Transactions:")
for row in rows:
print("Transaction ID:", row[0])
print("Transaction Type:", row[1])
print("Amount:", row[2])
print("Timestamp:", row[3])
print("------------------------")
else:
print("No transactions found.")
if choice == "1":
create_account()
elif choice == "2":
account_number = int(input("Enter the account number to delete: "))
delete_account(account_number)
elif choice == "3":
account_number = int(input("Enter your account number: "))
amount = float(input("Enter the withdrawal amount: "))
withdraw(account_number, amount)
elif choice == "4":
account_number = int(input("Enter your account number: "))
amount = float(input("Enter the deposit amount: "))
deposit(account_number, amount)
elif choice == "5":
from_account = int(input("Enter your account number: "))
to_account = int(input("Enter the recipient's account number: "))
amount = float(input("Enter the transfer amount: "))
transfer(from_account, to_account, amount)
elif choice == "6":
account_number = int(input("Enter your account number: "))
check_balance(account_number)
elif choice == "7":
display_accounts()
elif choice == "8":
plot_account_balance_graph()
elif choice == "9":
account_number = int(input("Enter your account number: "))
reset_pin(account_number)
elif choice == "10":
account_number = int(input("Enter your account number: "))
view_transactions(account_number)
elif choice == "11":
break
else:
print("Invalid choice. Please try again.")
OUTPUT
1. MAIN UI:
4. WITHDRAW MONEY:
6. TRANSFER:
Hardware
- Windows 7 or higher
- Python
- Visual Studio Code or Any IDE
BIBLIOGRAPHY
- Class Notes
- Google
- Bard
- Wikipedia
- Youtube
- Republic Bharat Tv