I’ve been trying to write my code for the counting cards program but for some reason I keep getting : " Cards Sequence 7, 8, 9 should return 0 Hold
Cards Sequence 3, 7, Q, 8, A should return -1 Hold
Cards Sequence 2, J, 9, 2, 7 should return 1 Bet
Cards Sequence 2, 2, 10 should return 1 Bet
Cards Sequence 3, 2, A, 10, K should return -1 Hold"
I added:
return “5 hold”;
to the case #'s 2 thru 6 and that gave me a check mark beside one of the objectives. But it also voided out the
break;
I added at the end.
I looked at the help videos as well as the solutions and as far as I can tell my code is no different from theirs. Can some one please tell me why my code wont work?
Well, you shouldnt return anything in the switch statement, only increment or decrement the global count variable which you are already doing in your code.
So try to remove returns in your switch statement.
PS: it would be better for us if you copy and paste your code here. the picture of it makes it hard.