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, 22.06.2019 06:30, miguel3maroghi
This technology is used to produce high-quality documents that look good on the computer screen and in print. wiki presentation paint desktop publishing
Answers: 3
image
Computers and Technology, 22.06.2019 15:50, minideeri
The file sales data. xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel. xlsm to find a nice color of gray.)
Answers: 2
image
Computers and Technology, 23.06.2019 00:00, addisonrausch
What season was better from fortnite?
Answers: 2
image
Computers and Technology, 23.06.2019 07:00, lin550
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
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
Chemistry, 25.03.2020 23:04