Write a program that simulates multiple games of blackjack

Assignment Help Basic Computer Science
Reference no: EM131305111

Blackjack (twenty-one) is a casino game played with cards. The goal of the game is to draw cards that total as close to 21 points as possible without going over. All face cards count as 10 points, aces count as 1 or 11, and all other cards count their numeric value.

The game is played against a dealer. The player tries to get closer to 21 (without going over) than the dealer. If the dealer busts (goes over 21), the player automatically wins (provided the player had not already busted). The dealer must always take cards according to a fixed set of rules. The dealer takes cards until he or she achieves a total of at least 17. If the dealer's hand contains an ace, it will be counted as 11 when that results in a total between 17 and 21 inclusive; otherwise, the ace is counted as 1.

Write a program that simulates multiple games of blackjack and estimates the probability that the dealer will bust. Hints: treat the deck of cards as infinite (casinos use a "shoe" containing many decks). You do not need to keep track of the cards in the hand, just the total so far (treating an ace as 1) and a bool variable hasAce that tells whether or not the hand contains an ace. A hand containing an ace should have 10 points added to the total exactly when doing so would produce a stopping total (something between 17 and 21 inclusive).

Reference no: EM131305111

Questions Cloud

Evaluate the impact of contemporary hr practices : Have a clear understanding of, and an ability to critically evaluate HRM and its role within the organisation and the wider the global environment - Be able to critically evaluate the main processes of employee resourcing, development, relations a..
What is the projected length of the project : What is the projected length of the project (in weeks)? What is the impact on the project (and the project manager) of changing the duration of task H from 2 weeks to 6 weeks?
End inventory level and inventory turnover ratio : Charlie's Cycles Inc. Has $110 million in sales. The company expects that its sales will increase 5% this year. Charlie's CFO uses a simple linear regression to forecast the company's inventory level for a given level of projected sales. Given the es..
Price of call option on the stock that has a strike price : Binomial Model The current price of a stock is $15. In 6 months, the price will be either $20 or $13. The annual risk-free rate is 4%. Find the price of a call option on the stock that has a strike price of $14 and that expires in 6 months.
Write a program that simulates multiple games of blackjack : Blackjack (twenty-one) is a casino game played with cards. The goal of the game is to draw cards that total as close to 21 points as possible without going over. All face cards count as 10 points, aces count as 1 or 11, and all other cards count t..
Call option on the stock that has a strike price : The current price of a stock is $22. In 1 year, the price will be either $28 or $15. The annual risk-free rate is 6%. Find the price of a call option on the stock that has a strike price is of $25 and that expires in 1 year.
Determines if the value is prime : Write a program that gets a starting value from the user and then prints the Syracuse sequence for that starting value.
Black-scholes option pricing model-what is options value : Black-Scholes Model Assume that you have been given the following information on Purcell Industries: Current stock price = $15 Strike price of option = $14 Time to maturity of option = 6 months Risk-free rate = 8% Variance of stock return = 0.11 d1 =..
Define a class to represent logical matrix : COMP3200: Object-Oriented Programming Assignment. Define a class (called LogMat) to represent logical matrix of any binary relation as explained previously. The class has three member variables: matrix (as dynamic 2-D array), rowSize and columnSize

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Centralized or decentralized account

Is an account created in Window 7 VM a centralized or decentralized account. If you wanted to log onto a second computer using the same username and password, what would you need to do first?

  Pushing the top-down agenda justified

Is Brown's hesitation in pushing the top-down agenda justified? Or should he be more aggressive in pushing his agenda throughout the enterprise?

  Rlogin possible security problems

Rlogin is most commonly deployed on corporate or academic networks, where user account information is shared between all the Unix machines on the network (often using NIS). But rlogin does have serious security problems. Please list rlogin's pos..

  Describe an algorithm for solving the shortest path problem

Describe an algorithm for solving the shortest path problem with these turn penalties and apply it to the shortest path example in Figure 4.15(b). Assume that α = 5.

  Discuss three standard configuration and security

In addition, discuss three standard configuration and security tools each OS provides. Search the web and describe two third-party or open source tools that can help with managing your OS's security configuration. In what ways do these third-party to..

  Appropriate microsoft office application

Submit your assignment in the appropriate Microsoft Office application(s) using the filename "Last name_First initial_OYO#" in addition to the appropriate filename extension (e.g., .docx, .dotx, .htm, etc.). For example: If your name is Mary Smith, t..

  Calculate the exit pressure

Heat transfer occurs from the steam to its surroundings at a rate of 19.59 Btu per lb of steam flowing. Neglecting potential energy effects, determine the exit pressure, in lbf/in.2

  Python program that replaces text in a file

Python Assignment: Write a python program that replaces text in a file. Your program should prompt the user to enter a filename, an old string, and a new string.

  How should her managers react to this behavior

How should her managers react to this behavior?

  Question regarding the protecting personal data

Your customer is a community clinic that works with families with problems of family violence. It has three sites in the same city, including a shelter for battered women and children. The director wants a computerized record and appointment syste..

  Visual walk-through of the many aiu success

You will create a PowerPoint presentation that provides new students with a visual walk-through of the many AIU success and technology options. Not only should you describe them; you should explain when and why you might use each one of these item..

  Explain how names are translated

Explain how names are translated (resolved) into IP address.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd