Question
Use Python to build a fully functional (sans actual money) ATM machine. When the user starts the program, their current bank balance should be shown.
Use Python to build a fully functional (sans actual money) ATM machine. When the user starts the program, their current bank balance should be shown. At that point, the user must have the option to do the following:
1. Deposit Money
If the user has a balance of $0, they will be required to make a deposit of $100 or more. For any deposit thereafter, the user can enter any amount they would like, even amounts less than $1.00. Each deposit will be added to the user's total and at the end of the transaction, the current balance will be displayed to the user. The user must be given the option to enter additional deposits until they no longer want to.
2. Withdrawals
If the user has a balance of $0, they will be prohibited from making withdrawals; an error message should be shown to the user in this situation. However, they must be given the option to perform additional transactions. If the user has a balance greater than $0 and their withdrawal amount is more than the balance, they will not be able to complete the transaction but should be given as many chances as possible to enter an appropriate withdrawal amount. If the user enters a withdrawal amount less than the balance, the withdrawal amount should be subtracted from the balance and at the end of the transaction, the current balance will be displayed to the user. The user must be given the option to make additional withdrawals until they no longer want to.
3. Balance information
Once the user is shown their current balance, they must be given the option to perform additional transactions.
In addition to showing the user their current balance, display to the user what their last transaction was (deposit, withdrawal, none)
Step by Step Solution
3.47 Rating (147 Votes )
There are 3 Steps involved in it
Step: 1
Balance 0 while True printYour current balance is strBalance printWhat would you like to ...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