Thur, 12th Nov 2015, 23:55 Re: Programming Lab Stack Execution Question
A student writes: > Dear Dr. Patt, > > I was working on the upcoming programming assignment earlier when I noticed > in your instructions you noted that the status (success or failure) of the > stack execution of the equation should be stored into R5. I can understand > why this is a necessity, but I don't understand how to write this. Is there > something that will be unique to a successful execution that a failed > execution lacks or vice versa? Any clarification would be appreciated. > > Thanks! > > <<name withheld to protect the student who asks what's unique about a successful execution>> If you do not try the extra credit, you will assume (as we said) that all input strings are properly formed and you will never get a failure. If you try the extra credit, then you need to detect bad strings. If you try to process a bad string, the push or pop will fail to work properly. Now a question for you: Why would an improper string not allow your program to properly evaluate it. A simple example of an improper string should show you the problem. Good luck. Yale Patt