13. Write a program that plays a simplified dice version of blackjack. Instead of selecting from a deck of cards a 14-sided die is rolled to represent a card. The rules of the game for one round, as played against the house, are as follows: a. A roll randomly selects from the values 2-10 or Jack, Queen, King, or Ace. An Ace always has the value of 11. Jack, Queen, and King all have the value of 10. In other words, with equal probability, a roll selects one of 2,3,4,5,6,7,8,9,10,10,10,10,11. b. The human player enters a wager. The wager must be positive and must not exceed the amount of money possessed by the player. c. The player is given two rolls. The house, played by the computer, is given one roll. The player is shown the value of the house's roll. d. If the total of the rolls is 22 or greater than the player "busts", loses the wager, and the round is over. e. If the total of the rolls is 21 or less then the player has the option to "hit" or "stand". If the player opts to "hit" then the player is given another roll. Return to step 4. If the player opts to "stand" then continue to step 6. f. It is now the house's turn. The house is given an additional roll and the values are summed. If the total is less than 17 then the house must "hit". If the house has a total of 22 or greater than the house "busts", the player wins the wager, and the round is over. The house must continue to hit until it either "busts" or has a value between 17 and 21. g. If the house did not "bust" then its value is compared to the player's total. If the totals are the same then it is a "push" and the player does not win or lose anything. If the house's total is greater than the player's, then the player loses the wager. If the player's total is greater than the house's, then the player wins the wager. Write a program that repeats a round until the player decides to quit or runs out of money. Start the player with $100. Design your program using classes and methods. Your entire program should not be in a single main method.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Need to handle in java

13. Write a program that plays a simplified dice version of blackjack. Instead of selecting from a deck of cards a 14-sided die is rolled to represent a card. The rules
of the game for one round, as played against the house, are as follows:
a. A roll randomly selects from the values 2-10 or Jack, Queen, King, or Ace. An Ace always has the value of 11. Jack, Queen, and King all have the value
of 10. In other words, with equal probability, a roll selects one of 2,3,4,5,6,7,8,9,10, 10, 10, 10, 11.
b. The human player enters a wager. The wager must be positive and must not exceed the amount of money possessed by the player.
c. The player is given two rolls. The house, played by the computer, is given one roll. The player is shown the value of the house's roll.
d. If the total of the rolls is 22 or greater than the player "busts", loses the wager, and the round is over.
e. If the total of the rolls is 21 or less then the player has the option to "hit" or "stand". If the player opts to "hit" then the player is given another roll. Return
to step 4. If the player opts to "stand" then continue to step 6.
f. It is now the house's turn. The house is given an additional roll and the values are summed. If the total is less than 17 then the house must "hit". If the
house has a total of 22 or greater than the house "busts", the player wins the wager, and the round is over. The house must continue to hit until it either
"busts" or has a value between 17 and 21.
g. If the house did not "bust" then its value is compared to the player's total. If the totals are the same then it is a "push" and the player does not win or lose
anything. If the house's total is greater than the player's, then the player loses the wager. If the player's total is greater than the house's, then the player
wins the wager.
Write a program that repeats a round until the player decides to quit or runs out of money. Start the player with $100. Design your program using classes and
methods. Your entire program should not be in a single main method.
Transcribed Image Text:13. Write a program that plays a simplified dice version of blackjack. Instead of selecting from a deck of cards a 14-sided die is rolled to represent a card. The rules of the game for one round, as played against the house, are as follows: a. A roll randomly selects from the values 2-10 or Jack, Queen, King, or Ace. An Ace always has the value of 11. Jack, Queen, and King all have the value of 10. In other words, with equal probability, a roll selects one of 2,3,4,5,6,7,8,9,10, 10, 10, 10, 11. b. The human player enters a wager. The wager must be positive and must not exceed the amount of money possessed by the player. c. The player is given two rolls. The house, played by the computer, is given one roll. The player is shown the value of the house's roll. d. If the total of the rolls is 22 or greater than the player "busts", loses the wager, and the round is over. e. If the total of the rolls is 21 or less then the player has the option to "hit" or "stand". If the player opts to "hit" then the player is given another roll. Return to step 4. If the player opts to "stand" then continue to step 6. f. It is now the house's turn. The house is given an additional roll and the values are summed. If the total is less than 17 then the house must "hit". If the house has a total of 22 or greater than the house "busts", the player wins the wager, and the round is over. The house must continue to hit until it either "busts" or has a value between 17 and 21. g. If the house did not "bust" then its value is compared to the player's total. If the totals are the same then it is a "push" and the player does not win or lose anything. If the house's total is greater than the player's, then the player loses the wager. If the player's total is greater than the house's, then the player wins the wager. Write a program that repeats a round until the player decides to quit or runs out of money. Start the player with $100. Design your program using classes and methods. Your entire program should not be in a single main method.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY