ram's chapter 10 answers

While AFAICS you do cover all of the scenarios here, for safety's sake I'd stick an else{} at the end which throws an error (as we don't expect the program to go there).