Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The game should begin by randomly dealing 2 cards to the user s hand, and then calculate and display the total. Next the program should

The game should begin by randomly dealing 2 cards to the users hand, and then calculate and
display the total.
Next the program should display a prompt, asking the user if he/she wants a Hit or to Stand.
If the user selects to Hit the game should randomly deal a new card to the users hand, and then
calculate and display the new total.
If the total is greater than 21, then the user Busts, the house wins, and a message
indicating these results is displayed.
If the total is less than 21, repeat the Hit/Stand Prompt to the user. Continue this process
until the user elects to Stand or Busts.
If the user selects to Stand, the game then randomly deals two cards to the house, and then
calculates those total points.
The dealer must continue to Hit as long as the total of the House had is under 17, display
the results after each Hit
The dealer must Stand once the House hand reaches 17 or higher. Once
If the user has not already Busted, compare the Users Hand to the House Hand and determine
and display the results. The player closes to 21 without going over wins.
Once a final game result has been displayed, prompt the user to see if he/she would like to play
again. If the user selects to play again, start the program from the beginning, otherwise display a
farewell message and terminate the program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+5. How would you rewrite the copy to make it more effective?

Answered: 1 week ago