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 10:30
What can tanya do now to start preparing for the college and scholarship application process? think about her grades, activities in which she can get involved, possible part-time jobs at which she can work, and standardized tests she can take. (10 points) apex
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
What is the foundation for proper monitoring, load balancing and routing in distributed systems
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
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, 23.11.2021 14:00
question
Mathematics, 23.11.2021 14:00
Questions on the website: 13722363