Case switch question .

Mar 14, 2015 at 5:04pm
Write your question here.
Why is it that I can only input four letters in a case. it only allows case 'feb':

example: case 'February': is a error

any help would be great.

thanks
try to get this!
Mar 14, 2015 at 5:10pm
As far as I know, cases only take characters or integers, not strings. Have you tried 'feb' and gotten it to compile?
Mar 14, 2015 at 5:16pm
Mar 14, 2015 at 5:19pm
Yes, but I need to input the whole month. I have tried to do a if statements but that just turns out wrong as well.
Mar 14, 2015 at 5:21pm
You cant input the whole month. You need to use if statements instead of switch case.
Mar 14, 2015 at 5:34pm
Gmoney, try using primitive association:

"January" = 0;
"February" = 1;

...

"December" = 11;
Mar 14, 2015 at 5:46pm
This helps!

THANKS FOLKS!..
Mar 14, 2015 at 5:48pm
Most certainly welcome..
Topic archived. No new replies allowed.