W8D2-Assignment-BankAccount

Overview

This project define a class called BankAccount, which simulates a simple bank account with basic functionalities. The class includes methods for depositing money, withdrawing money, checking the balance, and displaying account information.

There are 2 files in the project. The bankaccount.py defines the class and main.py instantiates 3 instances of the class and performs methods on each class.

Modules

No extra modules necessary

Features

The BankAccount includes the following methods:

  • deposit(amount): Adds the specified amount to the account balance.
  • withdraw(amount): Deducts the specified amount from the account balance, if sufficient funds are available.
  • get_balance(): Prints the current balance of the account.
  • display_account_info(): Prints out the account number, account holder name, and current balance.

How to use

  1. Create an Account: Instantiate the BankAccount class with account number, account holder name, and the initial balance.
  2. Depositing Money: Use the 'deposit' method to add money to the account.
  3. Withdrawing Money: Use the 'withdraw' method to add money to the account.
  4. Checking the Balance: Use the 'get_balance' method to print the current balance.
  5. Displaying Account Information: Use the 'display_account_info' method to print out account details.