Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLE HELP ME BY PYTHON PLE HELP ME BY PYTHON In this project, you will write two files: a class that represents a bank account
PLE HELP ME BY PYTHON
PLE HELP ME BY PYTHON
In this project, you will write two files: a class that represents a bank account and a program that works ike an ATM for bank accounts. The Bank Account Class In a file named account.py, create an Account class. An account object has these attributes: acct_number : the account number (an integer) name : the account holder's name pin: the account holder's PIN, which is a four-character string, since it can have leading zeros. balance : the current balance in the account, which is a float. Implement these methods: _init__(self, acct_number, name, pin, balance) The constructor _str_(self) Returns a string giving the account ID, name, PIN, and balance, separated by colons. Do not use format on the balance; you want to keep the number as accurate as possible. deposit(self, amount) Adds the given amount (a float ) to the current balance. If the amount is negative, the balance must not be changed; otherwise, the balance attribute is updated to reflect the deposit. This method returns the updated balance. withdraw(self, amount) Withdraws the given amount (a float ) from the current balance. If the amount is negative or greater than the current balance, the balance must not be changed; otherwise, the balance attribute is updated to reflect the withdrawal. This method returns the updated balance. Note that deposit and withdrawo do not print error messages if they get incorrect input; they simply ignore it. It is up to the program that calls these functions to provide the error messages for the user of the programStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started