Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ANSWER TO ALL MY QUESTIONS PLEASE AND THANK YOU. WHAT DO YOU SEE AS MISTAKE ON THOSE LINE: LINE 129,43,86,140,141,147,186,176,206,155, OR LINE: 39, 86, 142,

ANSWER TO ALL MY QUESTIONS PLEASE AND THANK YOU.

WHAT DO YOU SEE AS MISTAKE ON THOSE LINE: LINE 129,43,86,140,141,147,186,176,206,155, OR LINE: 39, 86, 142, 147, 155, 176, 178, 211. FIND 6 Problems fixed: Line number and new code. THANK YOU

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

17 public class BuggyBlackjack [ 18 19 private Scanner stdIn = new Scanner(System.in); 20 21 private Random random = new Random(OL); 22 // in production, you would want to randomize program behavior 23 // by seeding the random number generator with the clock value, 24 // but while debugging, you want the generated numbers to repeat, 25 // so we comment out the production statement and seed it with o 26 // in the line above 27 // private static Random random = new Random (System.currentTimeMillis(); 28 29 private int netUserwinnings; 30 private int amountofCurrentBet; 31 private int userwins; 32 private int ties; 33 private int userLosses; 34 35 36 * This method asks for and sets the bet amount 37 38 private void getAmountOfBet() { 39 int amountofCurrentBet = 0; 40 41 System.out.println("How much do you want to bet on this hand?"); 42 amountofCurrentBet = stdin.nextInt(); 43 while (amountofCurrentBet 10) { return card - 10; } else { return card; 1 } 87 88 89 90 91 92 93 94 * This method prints the current value of the user's winnings 95 private void reportCurrentWinnings() { 96 97 98 99 100 System.out.print("At this time "); if (netUserWinnings > 0) { System.out.println("'I owe you " + netUserwinnings + " dollars."); } else if (netUserWinnings = 22) { userLosses++; netUserWinnings -= amountOfCurrentBet; System.out.println("You busted!"); } else { // Dealer tips over the hole card System.out.println("My cards are: + stringForCard (dealersHoleCard) + !! + stringForCard (dealersNextCard)); // dealer takes cards until reaches 17 while (sumofDealerCards 21) { System.out.println("I busted! You win!"); netUserWinnings += amountOfCurrentBet; } else if (sumofDealerCards >= sumofuserCards) { user Losses++; System.out.println(sumofDealerCards + " beats + sumofuser Cards + ", so I win!"); netUserwinnings -= amountofCurrentBet; } else if (sumofDealerCards 21) { System.out.println("I busted! You win!"); netUserWinnings += amountOfCurrentBet; } else if (sumofDealerCards >= sumofuserCards) { user Losses++; System.out.println(sumo fDealerCards + " beats + sumofuserCards + ", so I win!"); netUserWinnings -= amountOfCurrentBet; } else if (sumofDealerCards 10) { return card - 10; } else { return card; 1 } 87 88 89 90 91 92 93 94 * This method prints the current value of the user's winnings 95 private void reportCurrentWinnings() { 96 97 98 99 100 System.out.print("At this time "); if (netUserWinnings > 0) { System.out.println("'I owe you " + netUserwinnings + " dollars."); } else if (netUserWinnings = 22) { userLosses++; netUserWinnings -= amountOfCurrentBet; System.out.println("You busted!"); } else { // Dealer tips over the hole card System.out.println("My cards are: + stringForCard (dealersHoleCard) + !! + stringForCard (dealersNextCard)); // dealer takes cards until reaches 17 while (sumofDealerCards 21) { System.out.println("I busted! You win!"); netUserWinnings += amountOfCurrentBet; } else if (sumofDealerCards >= sumofuserCards) { user Losses++; System.out.println(sumofDealerCards + " beats + sumofuser Cards + ", so I win!"); netUserwinnings -= amountofCurrentBet; } else if (sumofDealerCards 21) { System.out.println("I busted! You win!"); netUserWinnings += amountOfCurrentBet; } else if (sumofDealerCards >= sumofuserCards) { user Losses++; System.out.println(sumo fDealerCards + " beats + sumofuserCards + ", so I win!"); netUserWinnings -= amountOfCurrentBet; } else if (sumofDealerCards

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql++ For Sql Users A Tutorial

Authors: Don Chamberlin

1st Edition

0692184503, 978-0692184509

More Books

Students also viewed these Databases questions