Last picture is the states. So as descrbried above state is A and 0 goes to C and if 1 it goes to G.and the starting state is D.
Please write the c code. and no need for part one. Thank you!
3. Requirements The requirements to complete the lab are summarized below. 1. Draw a diagram of your state machine. 2. Create an executable program state (based on source code) that is able to respond to the commands described below. 3. Your program will be presented with zero or more commands from stain (each online by itself and most respond precisely as specified for each command as listed below. No Commands: Before any commands are issued to your program, it should print out the starting suite OnZero Commands: These commands aor an a line by itselt) must print to do the name of the next state given the supplied input, and update the current state. Change command: The change command is invoked by the letter followed by a l'ora followed by the name of a state de a single letter in the range AH). This command modifies the state machine such that their for 1) command applied to the current state will cause the machine to change to the named state and that this change is the state machine configuration will contine. This command should produce no output Print command: The petat command is invoked with the single letter pl. It should print to tlout the state machine configuration as currently specified (te, including changes that may have been made with change commande) in the same format that your state machine was specified with Garbage Identify command: This command is invoked with the single letters. It should identify all states that are reachable or unreachable from the current state. It always produces output to set If all states are reachable, it should output to garbage. Otherwise, it should output Garbage unreachabte atates where unreachable states> is the list of the state names that are no longer reachable. Delete command: This command is invoked with optionally followed by the name of a state to delete. When the command is invoked without the optional argument, it should delete the mark as "deleted) all un-deleted states that are unreachable. If there are no such unreachable un-deleted states, it should print Nostate deleted Otherwise, it should print the message Deleted wat op de eed atates If the command is followed by an apument that it the valid name of a state, it should print out either the message: Deleted if the state is not reachable and not already deleted. Otherwise, it should print out the message: Not deleted. If a state is successfully deleted, it should no longer appear in the list of states produced by the print command and it should be disallowed as a final argument to the change command. 4. Example The description of a state machine is given in a text file where each line has the following format:
is the name of the state being defined. is the name of next state if the input is ''; and is the name of next state if the input is T. All state names are single uppercase letters For example, given the state machine description and the information that the initial state is c BAA CAD DDC We can draw a picture of the state machine as shown below. A B 0,1 bio Figure 1 State Machine Diagram 4 of 5 Sample input and output is: Output 0 Input A 0 B Output Input Output Input Input COC 0 C Output P Input Output ABC BCA CAD DDC 9 Input Output No Garbage C1 B Input 9 Input Garbage: D d Deleted: D Output Input Output Input Output ABC BCA CAB Your persona ACG B DB CHF DFC E B FE G EH H GB Your starting 3. Requirements The requirements to complete the lab are summarized below. 1. Draw a diagram of your state machine. 2. Create an executable program state (based on source code) that is able to respond to the commands described below. 3. Your program will be presented with zero or more commands from stain (each online by itself and most respond precisely as specified for each command as listed below. No Commands: Before any commands are issued to your program, it should print out the starting suite OnZero Commands: These commands aor an a line by itselt) must print to do the name of the next state given the supplied input, and update the current state. Change command: The change command is invoked by the letter followed by a l'ora followed by the name of a state de a single letter in the range AH). This command modifies the state machine such that their for 1) command applied to the current state will cause the machine to change to the named state and that this change is the state machine configuration will contine. This command should produce no output Print command: The petat command is invoked with the single letter pl. It should print to tlout the state machine configuration as currently specified (te, including changes that may have been made with change commande) in the same format that your state machine was specified with Garbage Identify command: This command is invoked with the single letters. It should identify all states that are reachable or unreachable from the current state. It always produces output to set If all states are reachable, it should output to garbage. Otherwise, it should output Garbage unreachabte atates where unreachable states> is the list of the state names that are no longer reachable. Delete command: This command is invoked with optionally followed by the name of a state to delete. When the command is invoked without the optional argument, it should delete the mark as "deleted) all un-deleted states that are unreachable. If there are no such unreachable un-deleted states, it should print Nostate deleted Otherwise, it should print the message Deleted wat op de eed atates If the command is followed by an apument that it the valid name of a state, it should print out either the message: Deleted if the state is not reachable and not already deleted. Otherwise, it should print out the message: Not deleted. If a state is successfully deleted, it should no longer appear in the list of states produced by the print command and it should be disallowed as a final argument to the change command. 4. Example The description of a state machine is given in a text file where each line has the following format: is the name of the state being defined. is the name of next state if the input is ''; and is the name of next state if the input is T. All state names are single uppercase letters For example, given the state machine description and the information that the initial state is c BAA CAD DDC We can draw a picture of the state machine as shown below. A B 0,1 bio Figure 1 State Machine Diagram 4 of 5 Sample input and output is: Output 0 Input A 0 B Output Input Output Input Input COC 0 C Output P Input Output ABC BCA CAD DDC 9 Input Output No Garbage C1 B Input 9 Input Garbage: D d Deleted: D Output Input Output Input Output ABC BCA CAB Your persona ACG B DB CHF DFC E B FE G EH H GB Your starting