subject

In the card game named 'blackjack' players get two cards to start with, and then they are asked whether or not they want more cards. Players can continue to take as many cards as they like. Their goal is to get as close as possible to a total of 21 without going over. Face cards have a value of 10 Write a command line game that plays a simple version of blackjack. The between 1 and 10 each time the player gets a card. It should keep a running total of the play whether or not it should deal another card. Sample output for the game is written below. Your program should produce the same output. program should generate random number ers cards, and ask the player » First cards: 3, 2 » Total: 5 > Do you want another card? (y/n): y > Card: 6 Tota1: 11 > Do you want another card? (y/n): y > Card: 7 Tota1: 19 Do you want another card? (y/n): n > Would you like to play again? (y/n): y > First cards: 10, 2 > Total: 12 > Do you want another card? (y/n): y > Card: 6 > Total: 18 > Do you want another card? (y/n): y > Card: 7 Total: 25 Bust. > Would you like to play again? (y/n): n Note: You can generate random numbers using the Random class. Here is a tiny class that generates either a 0 or a l import java. util. public class RandomTest ( public static void main (String args[) Random random = new Random(); System. out-println (random. nextint (2))

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. andre was recently hired by an organization to check for system vulnerabilities. he is supposed to exploit these vulnerabilities and create a report on the extent of damage to which the system was susceptible. what position does andre hold in this organization? a. information security analyst b. information assurance manager c. penetration tester d. network security engineer e. chief information security officer
Answers: 2
question
Computers and Technology, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
The program below has been generalized to read a user's input value for hourlywage. run the program. notice the user's input value of 10 is used. modify that input value, and run again. generalize the program to get user input values for workhoursperweek and workweeksperyear (change those variables' initializations to 0). run the program. monthsperyear will never change, so define that variable as final. use the standard for naming final variables. ex: final int max_length
Answers: 2
question
Computers and Technology, 25.06.2019 04:30
Which relativos possible when two tables share the same primary key? a.) one-to-one b.) one-to-many c.) many-to-one d.) many-to-many
Answers: 2
You know the right answer?
In the card game named 'blackjack' players get two cards to start with, and then they are asked whet...
Questions
question
Mathematics, 17.09.2020 09:01
question
English, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
question
Mathematics, 17.09.2020 09:01
Questions on the website: 13722367