posted 12 years ago
You are probably better off creating an enum, like this:No messing around with unitialised states, and no breaking the method in the middle. Note you have a default value for the result, so you are regarded as losing if you enter featherDuster, or something else not recognised.
What the compiler was complaining about was that you have lots of if-elses, but there is still the possibility that you will have something which never fulfils any of the ifs, so you never return anything.