Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"


Create ATM Program with all operation when user will enter correct pin code then it will process

proceed  to next screen with following menu option

1.   Press C for Credit

2.   Press D for Debit

3.   Press B for Check Balance 

4:-  Press R for Repeat

5:-  Press E for exit


If Pin code will be incorrect then three attempt should be provide to user's to enter right pin code otherwise exit from System.

User can perform only three operation with one login session ,display complete log details after exit from System.





pin='1111'
flag=False
amt=5000
count=0
for i in range(1,4):
 pin = input("enter pin code")
 if pin=='1111':
     flag=True
     break
if flag:
    while(True):
        if count>3:
            exit(0)
        operation = input("""
                press c for creadit
                press d for debit
                press b for check balance
                press e for exit and press
                r for repeate operation""")
        if(operation =='d'):
          debit_amount = int(input("please enter the amount you want to debit"))
          if(debit_amount<amt):
            amt = amt-debit_amount
            print("now your current balance is ",amt,"and you have debited rupees ",debit_amount)
            count = count+1
            print(count)
          else:
             print("no sufficient balance in your account")
        if(operation =='c'):
            credit_amount = int(input("please enter the amount you want to credit"))
            amt = amt+credit_amount
            print("now your current balance is ",amt,"and you have credited rupees ",credit_amount)
            count = count+1
            print(count)
        if(operation =='b'):
            print("your current balance is = ",amt)
            count = count+1
            print(count)
        if(operation =='e'):
            exit(0)
        if(operation=='r'):
           count=0
           continue

else:
    print("you have entered wrong pin code and you complete your attempt")



Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post