import java.util.Scanner; public class Blackjack { public static Scanner scan = new Scanner(System.in); public static void main(String[] args) { System.out.println("\nWelcome to Java Casino!"); System.out.println("Do you have a knack for Black Jack?"); System.out.println("We shall see.."); System.out.println("..Ready? Press anything to begin!"); //Task 3 – Wait for the user to press enter. //Task 4 – Get two random cards. // – Print them: \n You get a \n" + + "\n and a \n" + //Task 5 – Print the sum of your hand value. // – print: your total is: //Task 6 – Get two random cards for the dealer. // – Print: The dealer shows \n" + + "\nand has a card facing down \n" + // – Print: \nThe dealer's total is hidden //Task 8 – Keep asking the player to hit or stay (while loop). // 1. Every time the player hits // – draw a new card. // – calculate their new total. // – print: (new line) You get a (new line) . // - print: your new total is // 2. Once the player stays, break the loop. //For tasks 9 to 13, see the article: Blackjack Part II. scan.close(); } /** Task 1 – make a function that returns a random number between 1 and 13 * Function name – drawRandomCard * @return (int) * * Inside the function: * 1. Gets a random number between 1 and 13. * 2. Returns a card. */ /** Task 2 – make a function that returns a String drawing of the card. * Function name – cardString * @param cardNumber (int) * @return (String) * * Inside the function: * 1. Returns a String drawing of the card. */ public static String faceDown() { return " _____\n"+ " | |\n"+ " | J |\n"+ " | JJJ |\n"+ " | J |\n"+ " |_____|\n"; } /** Task 7 – make a function that asks the user to hit or stay. * Function name – hitOrStay * @return (String) * * Inside the function: * 1. Asks the user to hit or stay. * 2. If the user doesn't enter "hit" or "stay", keep asking them to try again by printing: * Please write 'hit' or 'stay' * 3. Returns the user's option */ }