{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Project4

Project4 - CS 180 Project 4 1 BlackJack Win Percent Project...

This preview shows pages 1–2. Sign up to view the full content.

CS 180 Project 4 1 BlackJack Win Percent Project assigned on: Friday Feb 17 th 2012 Project due date: Thursday Feb 23 h 11:59 p.m. 2012 1.1 Description In this project, you are to write a program that estimates the probability of winning a blackjack game between you and a dealer. The program runs 1,000,000 rounds. For each round, you and the dealer draw two cards. For each hand, if the cards are worth 17 or more, don’t pick any more. If they are worth less than 17, draw a card. For our game, you can draw at most four (4) cards. After both hands are finished drawing, compare the totals. If the player “busts” (has a hand greater than 21), that is a loss. If only the dealer busts, the player wins. Otherwise, if the player has a higher hand, the player wins. If the dealer has the higher hand, the player loses. If they have the same value, they get a tie (“push”). After comparing the hands, the result is added to a win, loss, or tie count. After 1,000,000 rounds, print the percentage of winning, losing, and tieing hands with these rules. 2 Learning objectives 1. Learning how to separate code into methods to simplify code. 2. Using for loops to simulate a large number of actions. 3 Project Setup Create a project4 folder in your cs180 folder. Save all your Java source files in this project4 folder. You will be turning in the contents of this folder when the project is completed.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}