Answer
Constructing finite state in accordance with the Case study given
Work Step by Step
-Let $s_0$ be the start state and let $s_1$ be the state representing
a successful call.
- From $s_0$, inputs of 2, 3, 4, 5, 6, 7, or 8 send the machine back to $s_0$ with output of an error message for the user.
- From $s_0$ an input of 0 sends the machine to state $s_1$, with the output being that the 0 is sent to the network.
-From $s_0$ an input of 9 sends the machine to state $s_2$ with no output;
- from there an input of 1 sends the machine to state $s_3$ with no output;
-from there an input of 1 sends the machine to state $s_1$ with the output being that the 911 is sent to the network.
- All other inputs while in states $s_2$ or $s_3$ send the machine back to $s_0$ with
output of an error message for the user.
-From $s_0$ an input of 1 sends the machine to state $s_4$ with no output; from $s_4$ an input of 2 sends the machine to state $s_5$ with no output;
-and this path continues in a similar manner to the 911 path, looking next
for 1, then 2,
-then any seven digits, at which point the machine goes to state $s_1$ with the output being that the ten-digit input is sent to the network.
-Any “incorrect” input while in states $s_5$ or $s_6$ (that is, anything except a 1 while in $s_5$ or a 2 while in $s_6$) sends the machine back to$ s_0$ with output of an error message
for the user.
- Similarly, from $s_4$ an input of 8 followed by appropriate successors drives us eventually to $s_1$, but inappropriate outputs drive us back to $s_0$ with an error message.
-Also,
-inputs while in state $s_4$ other than 2 or 8 send the machine back to state $s_0$ with output of an error message for the user.