fork download
  1. #include <stdio.h>
  2.  
  3. //**************************************************************
  4. // Function: blackJackValue
  5. //
  6. // Purpose: Calculate the total points associated with the black jack hand
  7. //
  8. // Parameters:
  9. //
  10. // card1 - the first card in the hand
  11. // card2 - the second card in the hand
  12. //
  13. // Returns: value of the hand (in points)
  14. //
  15. //**************************************************************
  16.  
  17. int blackJackValue (char card1, char card2){
  18.  
  19. char hand[2][1] = {card1, card2}; //creating an array which holds the two cards associated with a specific hand. Each card is represented by a single character
  20. int cardValues[2]= {0,0}; //initializing an array that will hold the values of the two cards in the hand
  21.  
  22. /*First, should I count the number of Aces?*/
  23. cardValues[0]=10;
  24. cardValues[1]=10;
  25.  
  26. int totalPoints=10+10; //calculate the total points associated with a hand
  27. return totalPoints;
  28.  
  29. };
  30.  
  31. int main() {
  32. int totalPoints= blackJackValue('T','K');
  33. printf("Total Points Associated with Hand: %f\n", totalPoints);
  34. return 0;
  35. }
Success #stdin #stdout 0.01s 5328KB
stdin
Standard input is empty
stdout
Total Points Associated with Hand: 0.000000