subject

Asimple blackjack card game consists of a player and a dealer (the computer). a player is dealt cards, called a hand, as is the dealer. each card in the hand has a point value. cards with a number (2-10) have the number of points associated with their face value…e. g., a 5 has a value of 5 points. picture cards (jack, queen, king) each have a value of 10 points. an ace can have a value of 1 point or 11 points at the discretion of the player. the objective of the game is to get as close to 21 points as possible without exceeding 21 points. a player that goes over is out of the game. the dealer deals cards to itself and a player. the dealer must play by slightly different rules than a player. a game proceeds as follows: a player is dealt two cards face up. if the point total is exactly 21 the player wins immediately. if the total is not 21, the dealer is dealt two cards, one face up and one face down. a player then determines whether to ask the dealer for another card (called a "hit") or to "stay" with his/her current hand. a player may ask for several "hits." when a player decides to "stay" the dealer begins to play. if the dealer has 21 it immediately wins the game. otherwise, the dealer must take "hits" until the total points in its hand is 17 or over, at which point the dealer must "stay." if the dealer goes over 21 while taking "hits" the game is over and the player wins. if the dealer’s points total exactly 21, the dealer wins immediately. when the dealer and player have finished playing their hands, the one with the highest point total is the winner. play is repeated until the player decides to quit. a deck of playing cards contains 52 cards, made up of 13 cards from 4 suits (clubs, diamonds, hearts, and spades). you may assume that there are several decks or you may use a single deck. regardless of the implementation, cards will need to be recycled if all the cards are used and there is no winner yet. the deck, or decks, should be shuffled prior to the start of a new game…and there are several ways to do that using random numbers. it is up to you to determine how an ace is valued. one approach is to provide players with a choice. another approach is to program a strategy that will be automatically implemented. there are multiple strategies that can be used…one might be to always value an ace as 11 points so long as the total points in a hand will be 21 or less. a separate strategy may be needed for the dealer. in terms of program output, you can represent a playing card however you want. as an example, a queen of diamonds might be represented as q-d, and a 9 of clubs might be represented as 9-c. you must use an object-oriented approach in designing and implementing this program.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:00, mimithurmond03
Which is the highest level of the hierarchy of needs model? a. humanity b. intrapersonal c. team d. interpersonal
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, ayoismeisjjjjuan
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
image
Computers and Technology, 23.06.2019 22:50, christingle2004
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
image
Computers and Technology, 24.06.2019 15:30, S917564
The idea that, for each pair of devices v and w, there’s a strict dichotomy between being “in range” or “out of range” is a simplified abstraction. more accurately, there’s a power decay function f (·) that specifies, for a pair of devices at distance δ, the signal strength f(δ) that they’ll be able to achieve on their wireless connection. (we’ll assume that f (δ) decreases with increasing δ.) we might want to build this into our notion of back-up sets as follows: among the k devices in the back-up set of v, there should be at least one that can be reached with very high signal strength, at least one other that can be reached with moderately high signal strength, and so forth. more concretely, we have values p1 ≥ p2 ≥ . . ≥ pk, so that if the back-up set for v consists of devices at distances d1≤d2≤≤dk, thenweshouldhavef(dj)≥pj foreachj. give an algorithm that determines whether it is possible to choose a back-up set for each device subject to this more detailed condition, still requiring that no device should appear in the back-up set of more than b other devices. again, the algorithm should output the back-up sets themselves, provided they can be found.\
Answers: 2
You know the right answer?
Asimple blackjack card game consists of a player and a dealer (the computer). a player is dealt card...

Questions in other subjects:

Konu
Social Studies, 13.05.2021 02:10