[Solved] Create a solution designed to play Blackjack

$25

File Name: Create_a_solution_designed_to_play_Blackjack.zip
File Size: 414.48 KB

SKU: [Solved] Create a solution designed to play Blackjack Category: Tag:
5/5 - (1 vote)

ITCS 1213

In this project you will create a solution designed to play Blackjack. We will use simplerules of the game. Assume there exists a player and a dealer. The winner of the game isthe player who gets closest to 21 without exceeding 21 or going bust. If both playershave the same points, then neither player wins the hand. An ace has a value of 1 or 11.Face cards have a value of 10. The dealer must take a card if the dealers hand is worth16 or less. The dealer may not take a card if the hand is worth 17 or more. As the player,you may take a card at any time.Allow the user to play as many hands as he/she wants.Keep track of how many hands the dealer wins and how many hands the player wins.How to get started;Create a class called Card. The card has three fields, value and suit, face.The card class has a constructor that takes three values for the three fields.Do not create a no-args constructor.The Card class has three get methods to return the values of each of the fields.The Card class has a toString( ) method.The Card class has a compareTo( ) method that uses the value of the card to determinethe ordering. For this implementation the ordering is as follows: (high to low) A, K, Q, J,10, 9, 8, 7, 6, 5, 4, 3, 2Create a class called Deck. A deck has two fields- an array of Cards and an int whichholds the subscript of the Card at the top of the deck.The Deck class will have only one constructor, which will create the array. Try to thinkof a way to code this without writing 52 statements.The Deck class also has a method getTopCard( ) which returns a copy of the Card that isat the top of the array.The Deck class has a method called shuffle( ) which shuffles the array of Cards. Toshuffle, generate random numbers and use these to exchange array elements. Exchange1000 times in this method. If you are unsure of how to generate a random number afterreading the Java API documentation on the Random class, please ask in class.Create the driver class call it Game21.This is where your game logic will go. As a hint, you will need to create one Deckinstance and then call the shuffle method( ) for each. When you are testing as you write,before you shuffle( ) you may want to print out the entire Deck to make sure you havecreated the array of Cards correctly.Each player is dealt two cards to start. Then the rules stated above are followed. Only theuser has the choice whether to deal another card or quit. The dealer (computer) must bedealt another card from its deck if its total is 16 or under and must quit if its hand is 17 orover.Once a hand is won, either by the computer or the player, allow the player to decide ifhe/she wants to play another hand. Keep a running total of the number of hands won bythe computer and the number of hands won by the player.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Create a solution designed to play Blackjack
$25