This repository contains a simple console-based banking system implemented using Object-Oriented Programming (OOP) principles in Python. The system allows users to open new accounts, access existing accounts, make deposits, make withdrawals, view account balances, and view transaction history.
To run the program, follow these steps:
-
Clone the repository:
git clone https://github.com/osisamkay/simple-banking-system.git
-
Navigate to the project directory:
cd simple-banking-system
-
Run the main script:
python main.py
- Open a new account
- Access an existing account
- Make deposits
- Make withdrawals
- View account balances
- View transaction history
This project follows the four pillars of Object-Oriented Programming:
-
Encapsulation: The implementation of classes (
Account
andSavingsAccount
) encapsulates the related attributes and methods into objects. The internal details of how an account works are hidden from the external world. -
Abstraction: Abstract classes (
Account
) define a common interface for all types of bank accounts. The details of the account implementation are abstracted away, providing a clear separation between what an account does and how it does it. -
Inheritance: The
SavingsAccount
class inherits from the abstractAccount
class. Inheritance promotes code reuse, allowing theSavingsAccount
to inherit common methods and attributes from the base class. -
Polymorphism: Polymorphism is demonstrated through method overriding in the
SavingsAccount
class. Methods such asdeposit
,withdraw
,view_account_balance
, andview_transaction_history
provide different implementations specific to the savings account.
If you have suggestions or find issues, feel free to open an issue or create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.