Is there any reason why the program would ignore a switch statement?
I believe that its coded correctly, but none of the cases are acted upon. Thanks for any advice. Here's a copy of the switch code
Code:
switch (previousDives){
case ' 0 ' :
penalty = 0;
printf (" The secondary dive penalty is %d minutes.\n" , penalty );
break;
case ' 1 ' :
penalty = 4;
printf (" The secondary dive penalty is %d minutes.\n" , penalty );
break;
case ' 2 ' :
penalty = 10;
printf (" The secondary dive penalty is %d minutes.\n" , penalty );
break;
case ' 3 ' :
penalty = 17;
printf (" The secondary dive penalty is %d minutes.\n" , penalty );
break;
case ' 4 ' :
penalty = 27;
printf (" The secondary dive penalty is %d minutes.\n" , penalty );
break;
}
[edit]Code tags added by Hammer