top of page

Bank Account System: An Object-Oriented Finance Project

You have been assigned a project, "Bank Account System: An Object-Oriented Finance Project" that will enhance your Python skills and enable you to think like a programmer.

In this project, you will be required to design and develop a Bank Account Management System using Python which should allow users to create a bank account, deposit and withdraw funds from it, transfer funds between accounts, and display the balance of a particular account.


Below requirements are necessary for the project:

  • Python 3.0 (or higher),

  • Understanding of Python datatypes, dynamic statements, exception handling statements, built-in functions and methods, and

  • Basic knowledge of object-oriented programming concepts.


Please carefully read the requirement of this project, as they will serve as the foundation for you.

  • Account Creation: the program should prompt users to create a new bank account and asks for their name, account type, and initial deposit amount. Upon receiving the user's input, the program creates a new BankAccount object, stores it in a list of accounts, and associates it with the user.

  • Deposit: the program should prompt users to select the account they want to deposit money into. Upon selecting an account, the program allows the user to deposit money into the selected account. The program updates the account balance, and prints the updated balance to the console.

  • Withdrawal: the program should prompt users to select the account they want to withdraw money from. Upon selecting an account, the program checks if the account has sufficient balance to withdraw the requested amount. If the account has sufficient funds, the program allows the user to withdraw money from the selected account, updates the account balance, and prints the updated balance to the console.

  • Transfer: the program should prompt users to select the account they want to transfer money from, and then the account they want to transfer the funds to. Upon selecting the source and target accounts, the program checks if the source account has sufficient funds to transfer the requested amount. If the source account has sufficient funds, the program allows the user to transfer money from the source account to the target account, updates the balances of both accounts, and prints the updated balances to the console.

  • Print Account Balance: the program should prompt users to select the account they want to check the balance of. Upon selecting an account, the program prints the current balance of the selected account to the console.


Here are some functional and non-functional requirements [optional] for the project:

  • Code Documentation: the programmer should add comments to the code to explain what each method and function does. This makes it easier for others to understand the code and modify it if needed.

  • Error Handling: the programmer should add error handling to the program to ensure that the program does not crash if the user inputs invalid data or if there are any errors during program execution.

  • Testing: the programmer should test the program thoroughly to ensure that it works as expected. They should create test cases to cover all possible scenarios, including edge cases.

  • User Interface: the programmer can create a simple user interface for the program using a graphical user interface (GUI) library such as Tkinter or PyQT. This can make the program more user-friendly and accessible to non-technical users.

  • Data Persistence: the programmer can implement data persistence by storing account data in a database or a file. This allows users to retrieve their account data even if they close the program or restart their computers.

  • Security: the programmer should implement security measures such as encryption to protect user data and prevent unauthorized access.

  • Documentation: the programmer should create documentation for the program, including a user manual and a technical documentation guide. This makes it easier for users and developers to understand how the program works and how to use it.



system's functionalities including account creation, deposit, withdrawal, transfer, and print account balance, each of which prompts the user to select an account and provides relevant information based on the user's inputs, and error handling, system/account security can help to build more advanced finance-related systems.


 

Code Output

Bank Account System: An Object-Oriented Finance Project

 

Code Documentation

This document provides a detailed explanation of the BankAccount class, which is designed to represent a simple bank account with basic operations such as deposit, withdrawal, transfer, and balance printing.


BankAccount Class


Attributes/Data Objects

  • accountName: a string representing the account holder's name.

  • accountType: a string representing the type of the account (e.g., "Savings" or "Checking").

  • accountBalance: a floating-point number representing the current balance of the account.


Constructor - __init__(self, accountName, accountType, initialBalance)

  • Initializes a new instance of the BankAccount class.

  • Parameters:

    • accountName (str): the name of the account holder.

    • accountType (str): the type of the account.

    • initialBalance (float): the initial balance of the account.

  • Actions:

    • Sets the accountName, accountType, and accountBalance attributes based on the provided parameters.

    • Calls the PrintBalance method to print the initial balance.


Methods

Deposit(self, amount)
  • Deposits a specified amount into the account.

  • Parameters:

    • amount (float): The amount to be deposited.

  • Actions:

    • Adds the deposited amount to the accountBalance.

    • Prints a message indicating the deposit and calls the PrintBalance method.


Withdraw(self, amount)
  • Withdraws a specified amount from the account.

  • Parameters:

    • amount (float): The amount to be withdrawn.

  • Actions:

    • Checks if the withdrawal amount is greater than the current balance.

    • If sufficient funds are available, deducts the withdrawal amount from the accountBalance.

    • Prints a message indicating the withdrawal and calls the PrintBalance method.


Transfer(self, amount, accountBeneficiary)
  • Transfers a specified amount from the current account to another account.

  • Parameters:

    • amount (float): The amount to be transferred.

    • accountBeneficiary (BankAccount): The beneficiary account object.

  • Actions:

    • Checks if the transfer amount is greater than the current balance.

    • If sufficient funds are available, deducts the transfer amount from the current account's accountBalance and adds it to the beneficiary account's accountBalance.

    • Prints a message indicating the transfer and calls the PrintBalance method for both accounts.


PrintBalance(self)
  • Prints the current balance of the account.

  • Actions:

    • Prints a message showing the account holder's name, account type, and current balance.


 

User Manual

The User Manual provides comprehensive guidance on installing and using the Bank Account Management System. It covers essential topics, including prerequisites, installation steps, and detailed instructions for creating accounts, making transactions, and checking balances. Users will find clear examples and troubleshooting tips to facilitate a seamless experience with the program.


Bank Account Management System


Table of Contents

1. Introduction

2. Getting Started

2.1 Prerequisites

2.2 Installation

3. Using the Bank Account Class

3.1 Creating a Bank Account

3.2 Making Deposits

3.3 Making Withdrawals

3.4 Transferring Funds

3.5 Checking Account Balance

4. Examples

5. Troubleshooting

6. Conclusion


1. Introduction

Welcome to the Bank Account Management System! This program provides a simple and convenient way to manage bank accounts with basic operations such as deposit, withdrawal, and fund transfer. This user manual is designed to guide you through the installation process and usage of the program.


2. Getting Started

2.1 Prerequisites

  • Python installed on your system (version 3.x recommended).

2.2 Installation

  1. Download the BankAccountManagementSystem.py file from the provided source {Your Code File}.

  2. Open a terminal or command prompt.

  3. Navigate to the directory where the BankAccountManagementSystem.py file is located.

  4. Run the following command to execute the program:

python BankAccountManagementSystem.py

3. Using the Bank Account Class

The Bank Account class provides the following methods for managing accounts:

3.1 Creating a Bank Account

To create a new bank account, instantiate the BankAccount class with the account holder's name, account type, and initial balance.

account = BankAccount("John Doe", "Savings", 1000.0)

3.2 Making Deposits

To deposit funds into the account, use the Deposit method and provide the deposit amount.

account.Deposit(200.0)

3.3 Making Withdrawals

To withdraw funds from the account, use the Withdraw method and provide the withdrawal amount.

account.Withdraw(100.0)

3.4 Transferring Funds

To transfer funds from one account to another, use the Transfer method and provide the transfer amount and the beneficiary account.

beneficiary_account = BankAccount("Jane Smith", "Checking", 500.0)
account.Transfer(150.0, beneficiary_account)

3.5 Checking Account Balance

To check the current account balance, use the PrintBalance method.

account.PrintBalance()

4. Examples

# create two bank accounts
account1 = BankAccount("John Doe", "Savings", 1000.0)
account2 = BankAccount("Jane Smith", "Checking", 500.0)

# perform transactions
account1.Deposit(200.0)
account1.Withdraw(100.0)
account1.Transfer(150.0, account2)

5. Troubleshooting

If you encounter any issues, ensure that Python is installed and that you are running the program in a compatible environment. Check for typos or errors in the provided commands.


6. Conclusion

Congratulations! You have successfully set up and used the Bank Account Management System. If you have any further questions or issues, refer to the troubleshooting section or consult the technical documentation for developers.

464 views0 comments

Comentarios


bottom of page