Python question. Please answer the questions according to the output pattern in the example. #deck_OOP. uni2emoji = {128

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Python question. Please answer the questions according to the output pattern in the example. #deck_OOP. uni2emoji = {128

Post by answerhappygod »

Python question. Please answer the questions according to the
output pattern in the example.
#deck_OOP.
uni2emoji = {128512: 'πŸ”', 127925: 'πŸ•', 127955: '🍟'}
print(uni2emoji)
Python Question Please Answer The Questions According To The Output Pattern In The Example Deck Oop Uni2emoji 128 1
Python Question Please Answer The Questions According To The Output Pattern In The Example Deck Oop Uni2emoji 128 1 (241.65 KiB) Viewed 37 times
PROBLEM 1: Instantiating objects (4 points) You and two friends would like to play card games (blackjack and poker) at home. Write a program that will simulate setting up these games using object-oriented programming. Example 1 Enter Player 1 name: Bruce Enter Player 2 name: Clark Enter Player 3 name: Diana (B)lackjack or (P)oker? B Bruce's hand: 9 of Spades Jack of Hearts Clark's hand: Jack of Clubs 8 of Diamonds Diana's hand: 6 of Clubs 10 of Spades . Deck set-up o Import deck_OOP. o Make two objects: blackjack_deck and poker_deck β€’ blackjack_deck should consist of six standard 52 card playing decks together (total 312 cards) poker_deck should consist of a standard 52 card playing deck. o Note: since these decks are only used for their given games, they should be stored as local variables in their respective game functions Game functions o Define three functions: blackjack, poker, and hand_reporter. o blackjack () should take a variable number of arguments (representing players), shuffle blackjack_deck, deal two cards from blackjack_deck to each player, and return the player's hand o poker() should take a variable number of arguments (representing players), shuffle poker_deck, deal five cards from poker_deck to each player, and return the player's hand o hand_reporter() should print the name (suit and value) of the cards in a given player's hand. Game set-up o Ask the user to enter the three player's names. Ask the user to choose between playing blackjack or poker. o Instantiate a hand object for each player. o Deal cards to players. o Report the cards each player has. Example 2 Enter Player 1 name: Harry Enter Player 2 name: Ron Enter Player 3 name: Hermione (B)lackjack or (P)oker? P Harry's hand: 9 of Spades 8 of Spades King of Diamonds 4 of Spades 6 of Hearts Ron's hand: 6 of Clubs 4 of Diamonds Ace of Hearts 7 of Hearts 2 of Hearts Hermione's hand: 9 of Hearts King of Hearts 3 of Clubs 7 of Diamonds 2 of Clubs You can assume no user entry errors. Below are some sample runnings of the program. Underlines indicate user input. # Note: see Extra Credit #1 before attempting this problem. You do not need to submit an extra script if you attempt extra credit.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply