subject

Create a code for playing blackjack The first part of the code will create two variable.
One for the first card you’re dealt and one for the second.
Add those two variable for the total score you have

Then
Create a while loop that will stop if your score becomes above 21 or if the user says that they wish to stay.
Inside the while loop have ask the user if they want to hit or stay. Inside of the question be sure to print the current total that the user has
If the user inputs “hit” add a random number between 1 and 11 to their score.
If they input “stay” then print their final score
Then
Create a code for the dealer
The dealer should also start with two cards (remember you can always copy and paste and then edit your code)
Create a while loop for the dealer. (there is rule that dealers must always hit if their total is 16 or under
Print the dealers score once they are done.

Finally
Check if your score is higher than the dealer’s.
If it is you win
If not, you lose

Remember.
If either the dealer or you reach over 21 then that person automatically loses

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:10, Tatertotzzzz
Write a method that accepts a string object as an argument and returns the number of words it contains. for instance, if the argument is "four score and seven years ago", the method should return the number 6. demonstrate the method in a program that asks the user to input a string and then passes that string into the method, printing out whatever the method returns.
Answers: 3
image
Computers and Technology, 23.06.2019 16:00, cravens511peeelg
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
image
Computers and Technology, 24.06.2019 02:30, talia43
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
image
Computers and Technology, 24.06.2019 07:30, sunny644
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
You know the right answer?
Create a code for playing blackjack The first part of the code will create two variable.
One...

Questions in other subjects:

Konu
Mathematics, 01.07.2019 16:30
Konu
Mathematics, 01.07.2019 16:30
Konu
Social Studies, 01.07.2019 16:30