Question: It is time to write code to play the game. Write a loop that runs while the user wants to play. Inside the loop,

It is time to write code to play the game. Write a loop that runs while the user wants to play. Inside the

It is time to write code to play the game. Write a loop that runs while the user wants to play. Inside the loop, ask if they want to play again. Every time you take input, follow it with a loop to validate that input. Write code that calculates the number of games played and output this information at the end of the loop. Ensure your output matches the following: ... Do you want to play blackjack (y/n): y PSP Assignment 2-202202 Page 8 of 22 Enter your name: Mike Do you want to play again (y/n): y Do you want to play again (y/n): y Do you want to play again (y/n): no ERROR: Only enter 'y' or 'n'. Would you like to play again (y/n): yes ERROR: Only enter 'y' or 'n'. Would you like to play again (y/n): n You played 3 games.

Step by Step Solution

3.53 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a loop that runs the blackjack game while the user wants to play you can use a while loop ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!