Answer to Question #227431 in Python for Wania

Question #227431
Make an algorithm using pseudocode and python which will get ATM pinhole from user, if the pin is 1234 display correct otherwise if the pin is incorrect 3 times display account locked.
1
Expert's answer
2021-08-19T03:22:02-0400
Algorithm:
Start
    Declare a variable timeTries=0
    while timeTries<3 do
       Read PIN
       Set timeTries to timeTries+1
       if PIN="1234" then
          Display "Correct"
          Exit while
    if timeTries=3:
       Display "Account locked"
Stop


Python code:
timeTries=0
while timeTries<3:
    PIN = input("Enter PIN: ")
    timeTries+=1
    if PIN=="1234":
        print("Correct")
        break
if timeTries==3:
    print("Account locked")




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