Question: java everything is one question and more description for the question Step 1: Player starts with money = $1000. Player needs to bet some money












Step 1: Player starts with money = $1000. Player needs to bet some money in the beginning: bet = amount from keyboard input Step 2: Player gets two random cards. Suit is generated randomly from Diamonds, Spades, Hearts, and Clubs. For each card, convert the card number to score: o Card number is generated from 1-13. o Score is not the same as the card number: If number=1 (Ace), score can be either 1 or 11 (player decides) If=11, 12, 13(Jack, Queen, and King), score is 10 . For others, score is the same as the number Total score = score of cardi + score of card2, if total score is larger than 21, bust, score=0 Step 3: Dealer gets score from a random number from 8-25 inclusive. If the number is larger than 21, get bust, score for deal is 0, otherwise no change. Step 3: Win-tie-loss: compare the player's score with dealer's score o If player's total score is more than dealer's score, the player won, money now = money + bet; o If player's total score is fewer than dealer's, player lost money = money-bet o if player ties the game, it is tie-game, money will not change; Step 4: print out: Dealer's score Player' cards plus score, and The current money amount for player. Game ends AVAIABLE FOR YOU TO START Sample Ouput 1: You have $1000 How many dollars you want to bet:100 Dealer Score = 12 First Suit Heart First Card = 3 First point = 3 Second Suit = Dimond Second Card = 8 Second point = 8 ***** You lost! you have $900. Your score is 11 The dealer's score is 12 ****** END of GAME Sample Ouput 2: You have $1000 How many dollars you want to bet:200 Dealer Score = 9 First Suit = Heart First Card = 13 First point = 10 Second Suit = Heart Second Card = 8 Second point = 8 You won! you have $1200. Your score is 18 The dealer's score is 9 ****** END of GAME ****** Sample Ouput 3: You have $1000 How many dollars you want to bet:99 Dealer Score = 20 Sample Ouput 3: You have $1000 How many dollars you want to bet:99 Dealer Score = 20 First Suit = Heart First Card = 1 you have ACE, you can choose 1 or 11 for this card?11 For Ace you picked 11 First point = 11 Second Suit = Dimond Second Card = 10 Second point = 10 You won! you have $1099. Your score is 21 The dealer's score is 20 ****** END of GAME **** The Partial Code is given below. You need to complete the parts marked, make the code run, and get the output as shown in the previous page. import java.util.Random; import java.util.Scanner; // blackjack simplified version part 1 public class BlackJackPart) { public static void main(String[] args) { Scanner input = new Scanner(System.in); int money - 1000; System.out.print("You have $" + money + "How many dollars you want to bet:"); int bet = input.nextInt();//you bet amount from keyboard 1/(0) for dealer: call the dealerScore method, get dealerScore int Score=dealerScore(); System.out.println(" Dealer Score = "+dScore); String suitNext: parts marked, make the code run, and get the output as shown in the previous page. import java.util.Random; import java.util.Scanner; // blackjack simplified version part 1 public class BlackJackPart1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int money = 1000; System.out.print("You have $" + money + "How many dollars you want to bet:"); int bet = input.nextInt(://you bet amount from keyboard //CO) for dealer: call the dealerScore method, get dealerScore int dScore = dealerScore(); System.out.println(" Dealer Score = "+dScore); String suitNext; int valueNext, pointNext1, pointNext2; //(1) player gets first card //(1.a) first suit name suitNext = getSuito: System.out.println(" First Suit="+ suitNext); //(1.b) first card value valueNext = drawCardo); System.out.println("First Card = "+ valueNext); //(1.c) first card point pointNext1 = getPoint(valueNext); System.out.println(" First point="+ pointNextl); 1/(2) player gets second card YOU NEED TO COMPELET THE SECOND CARD 13 Sum un and decide who wins // (3) Sum up and decide who wins int Score = 0; pScore=pScore + pointNext! + pointNext2; // (4) check bust if (pScore > 21) pScore =0; // who wins if (pScore > dScore) // player win, display their scores, money cal. and display money = money + bet; System.out.println(" You won! you have S" + money + ". Your score is" +pScore + " The dealer's score is " + dScore ); } FINISH THE TWO OTHER CASES: tie and lose } System.out.println(" ****** END of GAME //main //dealer score generated from random numbers: public static int dealerScore() { //COMPLETED THIS METHOD //use (int)Math.random()*18 + 8 to generate an integer in [8,25) l/but, if it is larger than 21, its score will be 0 //the return value will be in [0, 8-21] return score: }// dealerScore W get suit from (Diamond, ...- ], use random method public static String getSuit() { W (3) Sum up and decide who wins int Score = 0; pScore=pScore + pointNext] + pointNext2; W/ (4) check bust if (pScore > 21) pScore =0; // who wins if (pScore > Score) { // player win, display their scores, money cal. and display money = money + bet; System.out.println(" You won! you have $" + money + ". Your score is" +pScore + " The dealer's score is " + dScore); 3 FINISH THE TWO OTHER CASES: tie and lose 3 System.out.println(" ****** END of GAME ****** }/main 1/dealer score generated from random numbers: public static int dealerScore() { //COMPLETED THIS METHOD //use (int)Math.random()*18 +8 to generate an integer in [8,25) l/but, if it is larger than 21, its score will be 0 1/the return value will be in [0, 8-21] return score: }//dealerScore // get suit from [Diamond, .... ). use random method public static String getSuit() { The Partial Code is given below. You need to complete the parts marked, make the code run, and get the output as shown in the previous page. import java.util.Random; import java.util.Scanner; // blackjack simplified version part I public class BlackJackPart) { public static void main(String[] args) { Scanner input = new Scanner(System.in); int money=1000; System.out.print("You have $" + money + " How many dollars you want to bet:"); int bet = input.nextInt();//you bet amount from keyboard 1(O) for dealer: call the dealerScore method, get dealerScore int dScore=dealerScore(); System.out.println("Dealer Score = "+dScore); String suitNext; int valueNext, pointNext1, pointNext2; (1) player gets first card //1.a) first suit name suitNext = getSuit(); System.out.println(" First Suit="+ suitNext); //1.b) first card value valueNext = drawCard(); System.out.println("First Card = "+ valueNext); W/(1.c) first card point pointNext1 = getPoint(valueNext): System.out.println("First point = "+pointNextl); 1/(2) player gets second card YOU NEED TO COMPELET THE SECOND CARD // (3) Sum up and decide who wins // (3) Sum up and decide who wins int Score = 0; pScore=pScore + pointNext] + pointNext2; 1/ (4) check bust if (pScore > 21) pScore =0; // who wins if (pScore > Score) { // player win, display their scores, money cal. and display money = money + bet; System.out.println(" You won! you have $"+ money + ". Your score is" +pScore + " The dealer's score is" + dScore ); } FINISH THE TWO OTHER CASES: tie and lose } System.out.println("n END of GAME //main //dealer score generated from random numbers: public static int dealerScore() { //COMPLETED THIS METHOD //use (int)Math.random()*18 + 8 to generate an integer in (8,25) /but, if it is larger than 21, its score will be 0 //the return value will be in [0, 8-21] return score: }//dealerScore // get suit from (Diamond, ...), use random method public static String getSuit() { //the return value will be in (0,8-21] return score: }// dealerScore // get suit from [Diamond, ... ), use random method public static String getSuit() { String suit=null; // COMPLETE THIS METHOD return suit; } // return integer in [1, 13] public static int drawCardo return COMPLETE THIS PART // integer } // change value to score // if value is 1, for Ace case, give the player choice either 1 or 11 from keyboard public static int getPoint(int value){ int point; Scanner input = new Scanner(System.in); // complete this method return point: }//end of class The Partial Code is given below. You need to complete the parts marked, make the code run, and get the output as shown in the previous page. import java.util. Random; import java.util.Scanner; // blackjack simplified version part I public class BlackJackPart) { public static void main(String[] args) { Scanner input = new Scanner(System.in); int money = 1000; System.out.print("You have $" + money + " How many dollars you want to bet:"); int bet = input.nextInt();//you bet amount from keyboard 1/(0) for dealer: call the dealerScore method, get dealerScore int dScore = dealer Score(); System.out.println(" Dealer Score = "+dScore); String suitNext; int valueNext, pointNextl, pointNext2; 1/(1) player gets first card //(1.a) first suit name suitNext = getSuit(); System.out.println(" First Suit="+ suitNext); (1.b) first card value valueNext = drawCard(); System.out.println("First Card = "+ valueNext); //(1.c) first card point pointNext1 = getPoint(valueNext); System.out.println(" First point = "+ pointNextl); 1/(2) player gets second card YOU NEED TO COMPELET THE SECOND CARD // (3) Sum up and decide who wins parts marked, make the code run, and get the output as shown in the previous page. import java.util.Random; import java.util.Scanner; // blackjack simplified version part 1 public class BlackJackPart1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int money = 1000; System.out.print("You have $" + money + " How many dollars you want to bet:"); int bet = input.nextInt(://you bet amount from keyboard VICO) for dealer. call the dealerScore method, get dealerScore int Score = dealerScore(); System.out.println(" Dealer Score = "+dScore); String suitNext; int valueNext, pointNextl, pointNext2; (1) player gets first card //(1.a) first suit name suitNext = getSuito; System.out.println(" First Suit="+ suitNext); //(1.b) first card value valueNext = drawCardo); System.out.println("First Card = "+ valueNext); //(1.c) first card point pointNext1 = getPoint(valueNext); System.out.println("First point = "+pointNext1); 1/(2) player gets second card YOU NEED TO COMPELET THE SECOND CARD 13 Sum un and decide who wins // (3) Sum up and decide who wins int Score = 0; pScore=pScore + pointNext 1 + pointNext2; // (4) check bust if (pScore > 21) pScore =0; 1/ who wins if (pScore > Score) // player win, display their scores, money cal. and display money = money + bet; System.out.println(" You won! you have S" + money +". Your score is " +pScore + " The dealer's score is" + dScore ); } FINISH THE TWO OTHER CASES: tie and lose } System.out.println(" ****** END of GAME //main 1/dealer score generated from random numbers: public static int dealerScore() { //COMPLETED THIS METHOD //use (int)Math.random()*18 + 8 to generate an integer in [8,25) l/but, if it is larger than 21, its score will be 0 //the return value will be in [0, 8-21] return score; }// dealerScore W get suit from Diamond, ...), use random method public static String getSuit() { W (3) Sum up and decide who wins int Score = 0; pScore=pScore + pointNext] + pointNext2; W/ (4) check bust if (pScore > 21) pScore =0; // who wins if (pScore > dScore) { // player win, display their scores, money cal. and display money = money + bet; System.out.println(" You won! you have $" + money +". Your score is " +pScore + " The dealer's score is" + dScore ); } FINISH THE TWO OTHER CASES: tie and lose } System.out.println(" ****** END of GAME ****** "} /main //dealer score generated from random numbers: public static int dealerScore() { //COMPLETED THIS METHOD //use (int)Math.random()*18 +8 to generate an integer in [8,25) /but, if it is larger than 21, its score will be 0 //the return value will be in [O. 8-21] return score: }//dealerScore // get suit from (Diamond, ....), use random method public static String getSuit() {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
