logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Seth PowellResume writing
(5/5)

509 Answers

Hire Me
expert
Doug BeaucheminAccounting
(5/5)

960 Answers

Hire Me
expert
William DewarComputer science
(5/5)

901 Answers

Hire Me
expert
Anuja SharmaPsychology
(5/5)

593 Answers

Hire Me
Others
(5/5)

expand the program to also address that the dealer can get more cards than two

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Exercise 1.1. - Deck and hand

using blackjack_module.py above create a new python file, this is where the bulk of your code will be written. Import the module you have added to your project and feel free to give it an alias, like this:

import blackjack_module as bjm

Use the get_new_shuffled_deck () function when creating a variable that holds a list of cards (representing a shuffled deck of cards). This is used when you hand out cards later.
Make two lists, one representing the player's hand and one for the dealer.
Fill the player's and dealer's hand with two cards from the deck. (can make this as a function?)
Write a printout of what both the player has on hand, as well as the value of these, and the first card the dealer has on hand. For example. something like this:

"The cards have been dealt. You have an Eight of clubs and a Three of hearts, with a total value of 11.
The dealers visible card is a Five of hearts, with a value of 5. "

Exercise 1.2 - BlackJack
A)
Check if the player's hand is BlackJack (has a value of 21). In that case, write a suitable printout.
You can use the calculate_hand_value function to get the value of a hand.

B)
If it is not BlackJack, give the player two choices:
1 - Hit
2 - Stand

Print the choice the user made
Initially, create a simple implementation of "Stand":

C)
Create an implementation if the user selects "Hit":
Give the player a new card from the deck
Print the drawn card, and the updated hand and its value
Check if the player is "busted" (has over 21 in total value)
D)
Put all this logic in a loop that ends when the user selects "Stand" or the player is busted.

When all these sub-tasks are finished, you have a fully implemented (albeit somewhat simpler) round of BlackJack! :)

Task 1.3 - Reset and play several rounds

Allows you to play multiple rounds. After a round, you ask if the user wants to play another round or not. If another round is to be played, you must: empty your hands and get a new deck of cards.

Task 1.4 - Dealers round

We will expand the program to also address that the dealer can get more cards than two. Now that the user has selected "Stand", the dealer will receive a new card until the hand has a value of 17 or more.

 

Print the entire dealer's hand and the value of the hand
Prints the player's hand and the value of the hand
Create a function "print_result ()" which takes the value of the player's hand and the value of the dealer's hand as parameters. This should compare these and make different prints based on the result:
The dealer has over 21 and "busted", the player has won
The player has higher than the dealer, the player has won
The dealer has higher than the player, the player has lost (the house won)
The player and the dealer have liked, the player has neither won nor lost

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme