dmoj.ca/problem/ccc99s1 M::OJ PROBLEMS SUBMISSIONS USERS CONTESTS ABOUT CCC '99 S1 - Card Game Write a program that will keep score for a simple two-player game, played with a deck of cards. There are 52 cards in the deck; four of each of 13 possible names: two, three. four five, six, seven, eight, nine, ten, jack, queen, king, ace The cards labelled jack, queen, king, and ace are collectively known as high cards. The deck is shuffled and placed face-down on the table. Player A turns over the top card and places it on a pile; then player B turns over the top card and places it on the pile. A and B alternate until the deck is exhausted. The game is scored as follows: • If a player turns over an ace, with at least 4 cards remaining to be turned over, and none of the next 4 cards is a high card, that player scores 4 points • If a player turns over a • If a player turns over a • If a player turns over a king, with at least 3 cards remaining to be turned over, and none of the next 3 cards is a high card, that player scores 3 points queen, with at least 2 cards remaining to be turned over, and none of the next 2 cards is a high card, that player scores 2 points jack, with at least 1 card remaining to be turned over, and the next card is not a high card, that player scores 1 point Input Specification The input will contain 52 lines. Each line will and so on. Output Specification Whenever a player scores, print Player X scores n point (s). where X is the name of the player (A or 8 ) and n is the number of points scored ( 1, 2, 3, or 4). At the end of the game, print the total score for each player, on two lines: Player A: n point (s). Player 8: m point (s). e name of a card in the deck, in lowercase letters. The first line denotes the first card to be turned over, the next line the next card: Sample Input Copy
dmoj.ca/problem/ccc99s1 M::OJ PROBLEMS SUBMISSIONS USERS CONTESTS ABOUT CCC '99 S1 - Card Game Write a program that will keep score for a simple two-player game, played with a deck of cards. There are 52 cards in the deck; four of each of 13 possible names: two, three. four five, six, seven, eight, nine, ten, jack, queen, king, ace The cards labelled jack, queen, king, and ace are collectively known as high cards. The deck is shuffled and placed face-down on the table. Player A turns over the top card and places it on a pile; then player B turns over the top card and places it on the pile. A and B alternate until the deck is exhausted. The game is scored as follows: • If a player turns over an ace, with at least 4 cards remaining to be turned over, and none of the next 4 cards is a high card, that player scores 4 points • If a player turns over a • If a player turns over a • If a player turns over a king, with at least 3 cards remaining to be turned over, and none of the next 3 cards is a high card, that player scores 3 points queen, with at least 2 cards remaining to be turned over, and none of the next 2 cards is a high card, that player scores 2 points jack, with at least 1 card remaining to be turned over, and the next card is not a high card, that player scores 1 point Input Specification The input will contain 52 lines. Each line will and so on. Output Specification Whenever a player scores, print Player X scores n point (s). where X is the name of the player (A or 8 ) and n is the number of points scored ( 1, 2, 3, or 4). At the end of the game, print the total score for each player, on two lines: Player A: n point (s). Player 8: m point (s). e name of a card in the deck, in lowercase letters. The first line denotes the first card to be turned over, the next line the next card: Sample Input Copy
Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 3GZ
Related questions
Question
Write in python please
![dmoj.ca/problem/ccc99s1
OM::OJ PROBLEMS SUBMISSIONS USERS CONTESTS ABOUT
с
CCC '99 S1 - Card Game
Write a program that will keep score for a simple two-player game, played with a deck of cards. There are 52 cards in the deck; four of each of 13 possible names: two, three
five, six, seven, eight, nine, ten, jack, queen, king, ace. The cards labelled jack, queen, king, and ace are collectively known as high cards.
The deck is shuffled and placed face-down on the table. Player A turns over the top card and places it on a pile; then player B turns over the top card and places it on the pile. A and B
alternate until the deck is exhausted. The game is scored as follows:
82°F
• If a player turns over an ace, with at least 4 cards remaining to be turned over, and none of the next 4 cards is a high card, that player scores 4 points
• If a player turns over a
• If a player turns over a
• If a player turns over a
king, with at least 3 cards remaining to be turned over, and none of the next 3 cards is a high card, that player scores 3 points
queen, with at least 2 cards remaining to be turned over, and none of the next 2 cards is a high card, that player scores 2 points
jack, with at least 1 card remaining to be turned over, and the next card is not a high card, that player scores 1 point
Input Specification
The input will contain 52 lines. Each line will contain the name of a card in the deck, in lowercase letters. The first line denotes the first card to be turned over, the next line the next card;
and so on.
Output Specification
Whenever a player scores, print Player X scores n point (s). where X is the name of the player (A or B) and n is the number of points scored (1, 2, 3, or 4). At the
end of the game, print the total score for each player, on two lines:
Player A: n point (s).
Player B: m point (s).
Sample Input
four
Q Search
U
i
My C
Copy](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa5f8f0ae-846c-4e8d-a906-996dfc9afac9%2F60e24782-8aae-41d0-b818-28a8051f7907%2Froimsi5_processed.jpeg&w=3840&q=75)
Transcribed Image Text:dmoj.ca/problem/ccc99s1
OM::OJ PROBLEMS SUBMISSIONS USERS CONTESTS ABOUT
с
CCC '99 S1 - Card Game
Write a program that will keep score for a simple two-player game, played with a deck of cards. There are 52 cards in the deck; four of each of 13 possible names: two, three
five, six, seven, eight, nine, ten, jack, queen, king, ace. The cards labelled jack, queen, king, and ace are collectively known as high cards.
The deck is shuffled and placed face-down on the table. Player A turns over the top card and places it on a pile; then player B turns over the top card and places it on the pile. A and B
alternate until the deck is exhausted. The game is scored as follows:
82°F
• If a player turns over an ace, with at least 4 cards remaining to be turned over, and none of the next 4 cards is a high card, that player scores 4 points
• If a player turns over a
• If a player turns over a
• If a player turns over a
king, with at least 3 cards remaining to be turned over, and none of the next 3 cards is a high card, that player scores 3 points
queen, with at least 2 cards remaining to be turned over, and none of the next 2 cards is a high card, that player scores 2 points
jack, with at least 1 card remaining to be turned over, and the next card is not a high card, that player scores 1 point
Input Specification
The input will contain 52 lines. Each line will contain the name of a card in the deck, in lowercase letters. The first line denotes the first card to be turned over, the next line the next card;
and so on.
Output Specification
Whenever a player scores, print Player X scores n point (s). where X is the name of the player (A or B) and n is the number of points scored (1, 2, 3, or 4). At the
end of the game, print the total score for each player, on two lines:
Player A: n point (s).
Player B: m point (s).
Sample Input
four
Q Search
U
i
My C
Copy
![Sample Output
Player A scores 2 point(s).
Player A scores 1 point (s).
Player A scores 3 point(s).
Player B scores 3 point (s).
Player A scores 1 point (s).
Player B scores 4 point (s).
Player A: 7 point (s).
Player B: 7 point (s).
Comments](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa5f8f0ae-846c-4e8d-a906-996dfc9afac9%2F60e24782-8aae-41d0-b818-28a8051f7907%2Fva2q0gf_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Sample Output
Player A scores 2 point(s).
Player A scores 1 point (s).
Player A scores 3 point(s).
Player B scores 3 point (s).
Player A scores 1 point (s).
Player B scores 4 point (s).
Player A: 7 point (s).
Player B: 7 point (s).
Comments
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning