Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is the rubric for our final project that I\'m needing help with: Rubric for

ID: 3556272 • Letter: H

Question

Here is the rubric for our final project that I'm needing help with:

Rubric for Final Project:
=========================
Vanilla BlackJack: 20 pts.
   good coding practices (formatting, indentation, naming conventions)
   with one or more shoes, one deck shuffled at start of each shoe
   one player, tracking chips bought, amount won/lost, bj payoff of 1.5x
   dealer stays on soft 17 or above, does not check BJ before play,

Dealer behavior (5 possible pts.):
   More than one deck of cards: 1 pt.
   Parameterization (i.e. allow flag to be set at beginning of the game or in a constant) on shoe-ending criteria: 1 pt.
   Parameterization on blackjack payoff amount: 1 pt.
   Parameterization on whether dealer hits on "soft" (i.e., those where Ace is counted as 11) values over 17: 1 pt.
   Parameterization to make dealer play with a hole card that is checked for BJ before players continue playing: 1 pt.

Wagers (2 possible pts.):
   Enforce minimum and maximum wagers: 1 pt.
   Enforce wagers being a multiple of smallest chip times 2: 1 pt.

Doubling down (3 possible pts.):
   Allow doubling on any hand: 2 pts.
   Parameterization for alternate doubling rules (only 10-11, only 9-11, any): 1 pt.

Splitting pairs (8 possible pts.):
   Allow splitting: 5 pts.
   Parameterization for maximum number of splits: 1 pt.
   Parameterization for not splitting aces: 1 pt.
   Parameterization for only allowing one card on split aces and BJs only counting as a regular 21: 1 pt.

Insurance: 2 pts.

Surrender: 2 pts.

Multiple players (8 possible pts.):
   Up to seven players: 5 pts.
   Side bets by other players: 2 pts.
   Allow player to enter the game mid-shoe: 1 pt.

Graphical user-interface: 10 pts.

Strategy (15 possible points):
   Advise player on hit, double, split, insurance decisions according to a standard play book: 5 pts.
   Advise player based on current probabilities based on the cards observed so far: 5 pts.
   Simulate play based on above advice and record results: 5 pts.

Total possible points (out of 30): 75

I'm not wanting everything, but at least a little more than the minimum would be appreciated.

Here is the CardDeck class that we were given to use as a guide:

import java.util.Random;

/*
** CardDeck class: used for handling a large multiple-deck set of cards for Blackjack or other similar games.
*/
public class CardDeck
{
   public static final int CARDS_PER_DECK = 52;    // number of cards in a standard French deck
   public static final int NUM_SUITS = 4;          // number of suits in a standard French deck
   public static final int ACE = 1;                // card value representing an Ace
   public static final int KING = 13;              // card value representing a King
   public static final int QUEEN = 12;             // card value representing a Queen
   public static final int JACK = 11;              // card value representing a Jack
   public static final int NO_MORE_CARDS = 0;      // card value representing the end of deck (such as returned by nextCard for an empty deck)

   // Private fields
   private int current; // current top of the deck; next card to be returned by nextCard() is at cards[current-1]
   private int cards[]; // array of all the cards
   private Random rand; // random number generator used by randomCard()

   /*
   ** ctor: constructs a stack of cards with 52 * numDecks cards in it and sets it to start dealing at the top
   */
   public CardDeck( int numDecks )
   {
      rand = new Random();
      cards = new int[numDecks * CARDS_PER_DECK];
      current = 0;
      for( int deck = 0; deck < numDecks; deck++ )
         for( int suit = 0; suit < NUM_SUITS; suit++ )
            for( int val = ACE; val <= KING; val++ )
               cards[current++] = val;
   }

   /*
   ** nextCard(): deal the next card from the draw pile and place it in the discard pile; returns that card, or NO_MORE_CARDS if there are no cards in the draw pile
   */
   public int nextCard()
   {
      if( current < 0 )
         return NO_MORE_CARDS;
      current--;
      return cards[current];
   }
    
   /*
   ** shuffle(): make a random permutation of the current deck of cards
   */
   public void shuffle()
   {
      // return all the discards back to the draw pile
      current = cards.length;
    
      // pull out a card at random and place in discards until there are no more cards left in draw pile
      for( int i = 0; i < cards.length; i++ )
         randomCard();
       
      // return all the (random) discards back into the draw pile
      current = cards.length;
   }

   /*
   ** getNumCards(): number of cards left in the draw pile
   */
   public int getNumCards()
   {
      return current;
   }

   /*
   ** getTotalCards(): number of cards in total, i.e., the number in the discard pile plus the number in the draw pile
   */
   public int getTotalCards()
   {
      return cards.length;
   }

   /*
   ** getProportionLeft(): proportion of total deck remaining in the draw pile
   */
   public double getProportionLeft()
   {
      return (double) getNumCards() / getTotalCards();
   }

   /*
   ** static cardName1(card): return a 1-character string representation for the given card
   */
   public static String cardName1( int card )
   {
      switch( card )
      {
         case ACE: return "A";
         case 2: return "2";
         case 3: return "3";
         case 4: return "4";
         case 5: return "5";
         case 6: return "6";
         case 7: return "7";
         case 8: return "8";
         case 9: return "9";
         case 10: return "T";
         case JACK: return "J";
         case QUEEN: return "Q";
         case KING: return "K";
         case NO_MORE_CARDS: return "end of deck marker";
         default: return "?";
      }
   }

   /*
   ** displayDeck(): print out to console the entire contents of the deck (discard pile followed by the draw pile)
   */
   public void displayDeck()
   {
      for( int i = cards.length - 1; i >= 0; i-- )
      {
         if( i == current - 1 )
            System.out.print( "^" );
         System.out.print( cardName1( cards[i] ));
         if( i % 52 == 0 )
            System.out.println();
      }
   }

   /*
   ** randomCard(): like nextCard() except the card will be drawn at random from anywhere in the draw pile
   */
   public int randomCard()
   {
      int pick;
      int pickedVal;
    
      // pick a location and it's corresponding card at random from draw pile
      pick = rand.nextInt( getNumCards() );
      pickedVal = cards[pick];
    
      // move it to the discard pile by moving intervening draw pile cards down one slot
      current--;
      for( int i = pick; i < current; i++ )
         cards[i] = cards[i+1];
      cards[current] = pickedVal;
    
      // return the randomly picked card (now at bottom of discard pile)
      return pickedVal;
   }
}

Thank you in advance for your assistance.

Explanation / Answer

import java.util.Scanner; import java.util.Vector; /* Simulation of console-I/O program Blackjack, using ConsoleApplet as a basis. See the file ConsoleApplet.java for more information. */ public class BlackjackConsole { private static Scanner scanner = new Scanner(System.in); private int[] deck; // An array of 52 Cards, representing the deck. private int currentPosition; // Current position in the deck private Vector hand; // The cards in the hand. public static void main(String[] args) { new BlackjackConsole().run(); } public void run() { /* This program lets the user play Blackjack. The computer acts as the dealer. The user has a stake of $100, and makes a bet on each game. The user can leave at any time, or will be kicked out when he loses all the money. House rules: The dealer hits on a total of 16 or less and stands on a total of 17 or more. Dealer wins ties. A new deck of cards is used for each game. */ int money; // Amount of money the user has. int bet; // Amount user bets on a game. boolean userWins; // Did the user win the game? System.out.println("Welcome to the game of blackjack."); System.out.println(); money = 100; // User starts with $100. while (true) { System.out.println("You have " + money + " dollars."); do { System.out.println("How many dollars do you want to bet? (Enter 0 to end.)"); System.out.print("? "); bet = scanner.nextInt(); if (bet < 0 || bet > money) { System.out.println("Your answer must be between 0 and " + money + '.'); } } while (bet < 0 || bet > money); if (bet == 0) { break; } userWins = playBlackjack(); if (userWins) { money = money + bet; } else { money = money - bet; } System.out.println(); if (money == 0) { System.out.println("Looks like you've are out of money!"); break; } } System.out.println(); System.out.println("You leave with $" + money + '.'); } // end main() private boolean playBlackjack() { // Let the user play one game of Blackjack. // Return true if the user wins, false if the user loses. Vector dealerHand; // The dealer's hand. Vector userHand; // The user's hand. // Create an unshuffled deck of cards. deck = new int[52]; int cardCt = 0; // How many cards have been created so far. for (int suit = 0; suit