Gives the option of the Ace having values eleven or one iftypeequalsPlayer

Gives the option of the ace having values eleven or

This preview shows page 1 - 3 out of 3 pages.

//Gives the option of the Ace having values eleven or one if(type.equals("Player")) { System.out.println("Would you like to have the Ace equal one or eleven?"); if(s.nextLine().toLowerCase().equals("eleven")) { total = total + 11; System.out.println(type + " Current Total: " + total); } else if(s.nextLine().toLowerCase().equals("one")) { total = total + 1; System.out.println(type + " Current Total: " + total); } } else if(type.equals("Ninja Cat")) { total = total + 11; System.out.println(type + " Current Total: " + total); } break; //Case 11 sets randomly generated #11 equal to a Jack
Image of page 1
case 11: System.out.println(type + " Drew a Jack"); total = total + 10; System.out.println(type + " Current Total: " + total); break; //Case 12 sets randomly generated #12 equal to a Queen case 12: System.out.println(type + " Drew a Queen"); total = total + 10; System.out.println(type + " Current Total: " + total); break; //Case 13 sets randomly generated #13 equal to a King case 13: System.out.println(type + " Drew a King"); total = total + 10; System.out.println(type + " Current Total: " + total); break; //Sets total to actual value of any current cards #2-10 default: System.out.println(type + " Drew a " + currentCard); total = total + currentCard; System.out.println(type + " Current Total: " + total); } } //This method will start the dealing phase and call upon the //displayCard method void deal() { System.out.println("First card: "); displayCard(); System.out.println("Second Card: "); displayCard(); } //This method determines if it's the player's turn and asks whether player wants to hit.
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Fall '16
  • Randomness, Playing card, System.out.println, Busts

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture