This project implements a simple bank account management system using object-oriented programming in Python. The system consists of two classes: BankAccount and SavingAccount.
1. BankAccount Class:
This class represents a basic bank account with attributes for account number and balance.
It includes methods for depositing funds (deposit()), withdrawing funds (withdrawal()), and checking the account balance (check_balance()).
The deposit() method increases the account balance by the specified amount, while the withdrawal() method decreases the balance.
The check_balance() method returns the current balance of the account.
2. SavingAccount Class (Inheritance):
This class inherits from the BankAccount class, extending its functionality with an additional method for calculating interests.
The constructor (__init__()) of the SavingAccount class initializes the account number and balance using the parent class's constructor (BankAccount.__init__()).
The interests() method calculates and adds interests to the account balance, simulating a savings account feature.
Usage:
Users can create instances of the SavingAccount class by providing an account number and initial balance.
They can then interact with the account by depositing funds, withdrawing funds, checking the balance, and calculating interests.
Example:
User inputs the deposit amount.
The deposit is processed, and the new balance is displayed.
User inputs the withdrawal amount.
The withdrawal is processed, and the new balance is displayed.
User inputs the interest amount.
Interests are calculated and added to the account balance, and the new balance is displayed.
This project serves as a basic demonstration of object-oriented programming concepts in Python and provides a foundation for more complex banking systems or financial applications. It allows users to manage bank accounts efficiently and perform common banking operations.