Counting Cards //why is this not working?

Counting Cards //why is this not working?

if (card>=2 && card<=6){
return count++;

how to make the code not stop here and go to a 2nd if statement for the count value and bet or hold?

and can these comparison operators work with strings “k” “A”?


Do not put the return statement in until you are ready to create the final string.

  if (card>=2 && card<=6)
  else if (card>=7 && card<==10||card==="J"||card==="Q"||card==="K"||card==="A")

    return count + " Bet";
    return count + " Hold";

is this close?


Read the instructions again. What should happen if the card value is 7, 8, or 9?


0 and we shouldn’t count it.


Exactly, so don’t include those numbers in your else if logic. With your last code posted, you would be subtracting one from count for number 7, 8, or 9.