Write a Python program that simulates a simple bank account management system . The program should allow
Question:
Write a Python program that simulates a simple bank account management system. The program should allow users to perform the following operations:
- Create Account: Users can create a new bank account by providing their name, initial balance, and an account number.
- Deposit: Users can deposit a specified amount into their account.
- Withdraw: Users can withdraw a specified amount from their account (if sufficient balance is available).
- Check Balance: Users can check their account balance.
- Display Account Details: Display the account holder’s name, account number, and current balance.
Requirements:
- Use classes and object-oriented programming to design the bank account system.
- Implement error handling for cases such as insufficient balance during withdrawal.
- Store account details in a dictionary or a list of objects.
- Write a simple menu-driven interface for users to interact with the system.
Sample Code Structure:
class BankAccount:
def __init__(self, account_number, account_holder, initial_balance):
# Your code here
def deposit(self, amount):
# Your code here
def withdraw(self, amount):
# Your code here
def check_balance(self):
# Your code here
def display_details(self):
# Your code here
# Example usage:
account1 = BankAccount("12345", "Alice", 1000)
account1.deposit(500)
account1.withdraw(200)
account1.display_details()
Business Intelligence And Analytics Systems For Decision Support
ISBN: 9781292009209
10th Global Edition
Authors: Efraim Turban, Ramesh Sharda, Dursun Delen, Pearson Education Limited, Dennis G. Zill