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

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

View Full Document Right Arrow Icon
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. Note: Use the commands below, if needed.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2012 for the course CS 180 taught by Professor Staff during the Spring '08 term at Purdue University.

Page1 / 5

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online