All assignments will be handed in using WebCT. Your MUSS userid is your userid for WebCT as well.
It seems that in some of the labs (like those ABB), cygwin is already installed. I definitely recommend learning vim (which I use all the time) or emacs (which I ought to use sometimes) for editing programs. Of course, you can use textpad too, but you will be less efficient if you do that. It takes a bit of time to learn, but the long-term rewards are definitely worth it!
Assignment 5 - This assignment requires you to write a finite state machine in two different ways.
As usual, find your id, and that page contains the transition table for your finite state machine.
Interpretation of the transition tables:
The functions to create should use the following prototype:
void fsm1(char *s); /* string from symbol alphabet */ void fsm2(char *s); /* string from symbol alphabet */
You may assume that the input to fsm1 and fsm2 consist of strings that are only from the symbol alphabet
First, for fsm1, write a state machine machine using if statements to encode the transition function.
Second, for fsm2, write a state machine machine using the transtion table directly to encode the transition function. In other words, store the table in a 5x5 array and use lookup to determine the next state.
In both cases, before fsm1 or fsm2 exit, they would print ( using printf) "accept" or "reject" depending on whether the corresponding machine would accept or reject the input string.
Your program should contain a main() function which has some (hard-coded) test strings sent to both fsm1() and fsm2(). Make sure to have test cases (ie strings) that cause both 'accept' and 'reject' to be printed! In case your machine accepts all strings (or rejects all), write some explanation as to why you believe this is the case.
Deliverables: one (1) .c file saved as plain text containing the above 2 function and the main program.
Coming soon