Solution Found!
Construct a finite-state machine for entering a security
Chapter , Problem 14E(choose chapter or problem)
Problem 14E
Construct a finite-state machine for entering a security code into an automatic teller machine (ATM) that implements these rules: A user enters a string of four digits, one digit at a time. If the user enters the correct four digits of the password, the ATM displays a welcome screen. When the user enters an incorrect string of four digits, the ATM displays a screen that informs the user that an incorrect password was entered. If a user enters the incorrect password three times, the account is locked.
Questions & Answers
QUESTION:
Problem 14E
Construct a finite-state machine for entering a security code into an automatic teller machine (ATM) that implements these rules: A user enters a string of four digits, one digit at a time. If the user enters the correct four digits of the password, the ATM displays a welcome screen. When the user enters an incorrect string of four digits, the ATM displays a screen that informs the user that an incorrect password was entered. If a user enters the incorrect password three times, the account is locked.
ANSWER:
States:
S1: Enter first digit
S2: Enter second digit
S3: Enter third digit
S4: Enter fourth digit
S5: Display welcome screen
S6: Display incorrect password screen
Inputs: