Question: Bank Account Application In this assignment, you will create a Python program that simulates a simple bank account using the BAnkAccount class. The program allows

Bank Account Application
In this assignment, you will create a Python program that simulates a simple bank account using the BAnkAccount class. The program allows the user to perform basic Banking operations such as depositing, withdrawing, and checking their account balance.
Here is the UML diagram for a class.
BankAccount
__accountNumber
__accountName
__balance
__init__(accNo, accName, bal )
deposit(bal)
withdraw(bal)
get_balance()
__str__()
Create a file, BankAccount.py that implements the BankAccount class.
About UML Diagram
The BankAccount class, holds the account number, account name, and balance as attributes/properties and must implement the following methods:
The __init__ method has 4 parameter variables: self, accNo, accName, and bal. Each of the parameters is assigned to the corresponding objects attribute.
The deposit method has two parameter variables: self and amount. When the method is called, the amount is deposited into the account (The value of the parameter is added to the __balance attribute).
The withdraw method has two parameter variables: self and amount. When the method is called, the amount that is to be withdrawn from the account is passed into the amount parameter. Validation: If the withdrawal amount is greater than the balance amount in the bank, then display the message Insufficient balance
The get_balance method returns the value of the __balance attribute.
Implement the __str__ method. It is common practice to define a method that returns a string containing the objects state. In Python, you give this method a special name __str__. The __str__ method displays the account number, name, and balance.
You will next write the Tester program, Account_test.py.
Import the BankAccount class
import BankAccount
Define the main() function, In the main function
Get the Account information, account number, name, and balance amount from the user.
Create a BankAccount object.
Deposit the users paycheck. Prompt the user to enter payment for the week. Invoke the deposit function and pass the payment amount.
Display the balance by invoking the get_balance method.
Prompt the user to enter how much they would like to withdraw. Pass the amount to withdraw() method for withdrawal.
Display the balance, make sure to format the balance amount to 2 decimal places.
Invoke the __str__ method that displays the state of the object.
Sample output:
Welcome to BankAccount Application!
Enter the account #: 11677
Enter the Account Name: Jane Doe
Enter your starting balance: 1000.00
How much money would you like to deposit? 500
I will deposit the amount into your account.
Your balance is $1,500.00
How much would you like to withdraw? 400
I will withdraw the amount from your account.
Your balance is $1,100.00
Your account information:
Account#: 11677
Account Name: Jane Doe
Account Balance: 1,100.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!