Counting Cards //why is this not working?

Counting Cards //why is this not working?
0

#21
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”?


#22

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


#23
  if (card>=2 && card<=6)
  {
     count++
  }
  
  
  else if (card>=7 && card<==10||card==="J"||card==="Q"||card==="K"||card==="A")
  { 
     count--
  }

  if(count>0){
    return count + " Bet";
  }else{
    return count + " Hold";
  }

is this close?


#24

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


#25

0 and we shouldn’t count it.


#26

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.