Advanced Project Exercises

4.8 (Blackjack App) Create a Blackjack card game app. Two cards each are dealt to the dealer and the player. (We provide card images with the book’s examples.) The player’s cards are dealt face up. Only the dealer’s first card is dealt face up. Each card has a value. A card numbered 2 through 10 is worth its face value. Jacks, queens and kings each count as 10. Aces can count as 1 or 11—whichever value is more beneficial to the player. If the sum of the player’s two initial cards is 21 (that is, the player was dealt a card valued at 10 and an ace, which counts as 11 in this situation), the player has “blackjack” and the dealer’s face-down card is revealed. If the dealer does not have blackjack, the player immediately ...

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.