You should theoretically allow bases beyond a radix of 16. I see your switch only goes to F/f, when it should go to Z/z. To make it easier on yourself, check whether it's a letter and uppercase and convert to lowercase if so. Then do the standard equation you are using to convert it to it's decimal representation.
My two cents.