exercises/ex01/cards.c
int checkType(char *card_name){
  int val = 0;
  switch(card_name[0]) {
    case 'K': case 'Q': case 'J':
      val = 10;
      break;
    case 'A':
      break;
    case 'X':
      val = -1;
      break;
    default:
      val = atoi(card_name);
      if ((val < 1) || (val > 10)){
        puts("I don't understand that value!");
      }
    }
    return val;
}
/* Classifies card entry taken from userOutput() as
  high, low, neutral, invalid, or exit condition.
  Returns val, the result of classification.

  Assumes user typed letters in caps.
  card_name: stored result from userOutput()
  val: classifies card. note that 10 is high, -1 is
  used as a flag to check the exit condition.
*/
Classifies card entry taken from userOutput() as
high, low, neutral, invalid, or exit condition.
Returns val, the result of classification.

Assumes user typed letters in caps.
card_name: stored result from userOutput()
val: classifies card. note that 10 is high, -1 is
used as a flag to check the exit condition.
Classifies card entry taken from userOutput () as high low neutral invalid or exit condition . Returns val the result of classification . Assumes user typed letters in caps . card_name : stored result from userOutput () val : classifies card . note that 10 is high - 1 is used as a flag to check the exit condition .
int checkType(char *card_name){
  int val = 0;
  switch(card_name[0]) {
    case 'K': case 'Q': case 'J':
      val = 10;
      break;
    case 'A':
      break;
    case 'X':
      val = -1;
      break;
    default:
      val = atoi(card_name);
      if ((val < 1) || (val > 10)){
        puts("I don't understand that value!");
      }
    }
    return val;
}
int checkType ( char * card_name ) { int val = 0 ; switch ( card_name [ 0 ] ) { case ' ' : case ' ' : case ' ' : val = 10 ; break ; case ' ' : break ; case ' ' : val = -1 ; break ; default : val = atoi ( card_name ) ; if ( ( val < 1 ) || ( val > 10 ) ) { puts ( " " ) ; } } return val ; }
Classifies card entry taken from userOutput() as
high, low, neutral, invalid, or exit condition.
Classifies card entry taken from userOutput () as high low neutral invalid or exit condition .