0% found this document useful (0 votes)
7 views3 pages

CS Project

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

CS Project

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

print("1.

Withdraw Amount")
print("2. Add Amount")
transaction_choice = int(input("Enter your
choice: "))

if transaction_choice == 1:
amount1 = float(input("Enter Withdrawal
Amount: "))
cur.execute(f"UPDATE customer_details
SET credit_amount = credit_amount - {amount1} WHERE
account_no = {account_no}")
print("Amount Withdrawn Successfully!")

elif transaction_choice == 2:
amount2 = float(input("Enter Amount to
Add: "))
cur.execute(f"UPDATE customer_details
SET credit_amount = credit_amount + {amount2} WHERE
account_no = {account_no}")
print("Amount Added Successfully!")

elif choice == 3:
account_no = int(input("Enter Your Account
Number: "))
cur.execute(f"SELECT * FROM customer_details
WHERE account_no = {account_no}")
account_data = cur.fetchone()

if account_data is None:
print("Invalid Account Number")
else:
print(f"\nAccount Number:
{account_data[0]}\nAccount Name: {account_data[1]}\
nPhone Number: {account_data[2]}\nAddress:
{account_data[3]}\nGender: {account_data[4]}\nAge:
{account_data[5]}\nCredit Amount: {account_data[6]}")

elif choice == 4:
try:
account_no = int(input("Enter Your
Account Number: "))
cur.execute(f"SELECT * FROM
customer_details WHERE account_no = {account_no}")
account_data = cur.fetchone()
if account_data is None:
print("Invalid Account Number")
else:
print("Amount added :",amount2)
print("Amount Withdrawn :",amount1
except:
print()
elif choice == 5:
account_no = int(input("Enter Your Account
Number to Edit: "))
cur.execute(f"SELECT * FROM customer_details
WHERE account_no = {account_no}")
account_data = cur.fetchone()
1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 6
Enter Your Account Number to Delete: 105
Account Deleted Successfully!
--- BANK MENU ---
1. Create Bank Account
2. Transaction
3. Customer Details
4. Transaction Details
5. Edit Account Details
6. Delete Account
7. Quit
Enter your choice: 4
Enter Your Account Number:101
Amount Withdrawn :50000

You might also like