subject

CODE THIS IN PYTHON Ninety-Nine is a two-player card game played with a deck of 40-cards. The cards are labeled 0 – 9. To start, each player gets 3 cards and the remaining cards are placed face
down on the table (the pile). In an actual game, the point total is set to zero but for this program, an initial point total will be given. Cards are played in the order they are added to a player’s hand. Each player in turn puts down a card and changes the point total according to the point value of his card and then selects a card from the top of the pile. Each card adds its face value in points (e. g. a 5 is worth five points) to the point total except for certain cards that have special values or meanings:
1. A 9 is a pass (and does not change point total)
2. A 4 subtracts 10 points from the total
3. A 0 adds either 1 or 11 to the point total. The 11 is played first as long as it does not put
the point total over 99.
If a player plays a card that puts the total over 99, that player loses the game.

INPUT:

An input line will contain 11 integers. The first integer gives the initial point total. The next 3 integers will represent the 3 cards dealt to the player. The remaining integers will be, in order, the card picked by the player and the card played by the dealer.

OUTPUT:

Print the point total when the game ends and who won (player or dealer).

SAMPLE INPUT OUTPUT

87, 5, 8, 9, 7, 4, 6, 3, 9, 0, 2 101,dealer

78, 2, 4, 8, 3, 8, 5, 0, 6, 9, 8 100,dealer

95, 9, 0, 9, 0, 1, 0, 1, 0, 2, 5 100, player

65, 0, 8, 0, 7, 0, 6, 0, 5, 1, 4 105, dealer

Manual Sample run:

87, 5, 8, 9, 7, 4, 6, 3, 9, 0, 2

P P P P D P D P D P

Total = 87
Players turn 5 Total 92
Dealers turn 4 Total 82
Players turn 8 Total 90
Dealers turn 3 total 93
Players turn 9 pass total 93
Dealers turn 0 Total 94
Players turn 7 Total 101
Total 101, Dealer is the winner as the card value exceeded when player was dealing the card

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:20
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
You know the right answer?
CODE THIS IN PYTHON Ninety-Nine is a two-player card game played with a deck of 40-cards. The cards...
Questions
question
Mathematics, 29.01.2020 03:40
question
Mathematics, 29.01.2020 03:40
question
Mathematics, 29.01.2020 03:40
question
Mathematics, 29.01.2020 03:40
question
Mathematics, 29.01.2020 03:40
question
Mathematics, 29.01.2020 03:41
question
Mathematics, 29.01.2020 03:41
question
Mathematics, 29.01.2020 03:41
Questions on the website: 13722360