subject

Write a program that uses the Die class that was presented in Chapter 4 to write a program that lets the user play against the computer in a variation of the popular blackjack card game. In this variation of the game, two six-sided dice are used instead of cards. The dice are rolled, and the player tries to beat the computer’s hidden total without going over 21. Here are some suggestions for the game’s design: Each round of the game is performed as an iteration of a loop that repeats as long as the player agrees to roll the dice, and the player’s total does not exceed 21. At the beginning of each round, the program will ask the user whether he or she wants to roll the dice to accumulate points. During each round, the program simulates the rolling of two six-sided dice. It rolls the dice first for the computer, then it asks the user if he or she wants to roll. (Use the Die class that was demonstrated in Chapter 4 to simulate the dice). The loop keeps a running total of both the computer and the user’s points. The computer’s total should remain hidden until the loop has finished. After the loop has finished, the computer’s total is revealed, and whoever the player with the most points without going over 21 wins.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
question
Computers and Technology, 24.06.2019 17:50
Acontact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. write a program that first takes in word pairs that consist of a name and a phone number (both strings). that list is followed by a name, and your program should output that name's phone number.
Answers: 1
question
Computers and Technology, 25.06.2019 04:30
What is the purpose of network permissions? a)to control access to network resources b)to convert to wireless networking c)to enable the installation of nics d)to reduce operating costs
Answers: 1
You know the right answer?
Write a program that uses the Die class that was presented in Chapter 4 to write a program that lets...
Questions
question
Mathematics, 19.02.2021 01:00
question
History, 19.02.2021 01:00
question
Mathematics, 19.02.2021 01:00
question
Mathematics, 19.02.2021 01:00
question
History, 19.02.2021 01:00
question
Mathematics, 19.02.2021 01:00
question
Mathematics, 19.02.2021 01:00
question
Mathematics, 19.02.2021 01:00
Questions on the website: 13722362