Answer to Question #320157 in Python for Eren

Question #320157

Simply ATM

Requirements:


  • The must be a main function that will display the menu and will ask for user's choice and pin.


The menu is shown below:

1 – Balance Inquiry

2 – Withdraw

3 – Deposit

X – Exit


  • For each choice 1, 2 and 3, create an appropriate user-defined function for each task.
  • Provide validation for input.


Score will be updated before encoded in BBL for the following:

  • 40 points deduction if there is no user defined function created at all.
  • 20 points deduction if all user defined function are void functions and no arguments.


Input


1. data

Output


Enter·pin:·123489
1·–·Balance·Inquiry
2·–·Withdraw
3·–·Deposit··
X·–·Exit
Enter·your·choice:··X
Thank·you·for·banking·with·us!
1
Expert's answer
2022-03-29T11:40:50-0400
balance = 1000
i = 0
a = (input("Enter·pin:·"))
print("1·–·Balance·Inquiry\n2·–·Withdraw\n3·–·Deposit··\n 4.Exit")
command = int(input("Enter number command"))

def BalanceInquiry(Balance):
        return balance
def Withdraw(Withdraw):
    if Withdraw >= balance:
        return None
    else:
        return balance - Withdraw
def Deposit(deposit):
    return deposit+balance

if command == 1:
    print(balance)
if command == 2:
    n = int(input("Enter withdraw money"))
    print(Withdraw(n))
if command == 3:
    n1 = int(input("Enter deposit money"))
    print(Deposit(n1))
if command == 4:
    print("Good bye")


   


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS