CS Project
CS Project
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