Chris Pollett>Old Classes>PIC 20, Winter 2000>Hw2>Hw2 FAQ

Winter 2000 PIC 20 HW2 FAQ Page

Do I have to use the finite automata to solve the first problem?

No. But you are strongly encouraged to do so. You ARE REQUIRED though to have at least one switch statement in your program. The intention was for you to use this to switch on which state of the automata you were in. Having experience with finite automata will serve you in good stead in a compilers class and also if you happen some day to need to some kinds of string matching.

Should I treat the cases where the length of the argument list was less than two separately?

No. You should use the same pattern not found message as in the other cases.

For problem 2 it might be useful to write some auxiliary methods for calculating things like midpoints. Is this okay?

Sure. It's fine. This will probably improve the readability of your code.