Details of this Paper

Write a C program function that takes the values of a two-card

Description

solution


Question

Write a C program function that takes the values of a two-card blackjack hands as input, and returns the point total of the hand. The value of the cards '2' through '9' is equal to their face value, the cards 'T', 'K', 'Q', 'J' are worth 10 points and the ace ('A') is worth 11 points unless it comes with another ace, then that second ace is worth 1 point. The program should be able to catch incorrect input.;For example;Enter cards: A Q The score is 21;Enter cards: A A The score is 12;Enter cards: T 7 The score is 17;Enter cards: A 5 The score is 16;Enter cards: 7 # *** Would be invalid, # is not a valid card;Enter cards: Z 4 *** Would be invalid, Z is not a valid card

 

Paper#69259 | Written in 18-Jul-2015

Price : $32
SiteLock