Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a program in C++ that simulates a Blackjack Slot Machine. When the program runs, it should do the following: a. Ask the user to

Design a program in C++ that simulates a Blackjack Slot Machine. When the program runs, it should do the following:

a. Ask the user to enter the account number.

b. Ask the user to enter the amount of money he/she wants to bet.

c. The program will randomly select and show the user two cards.

d. The program will randomly select another two cards and show one card (dealers cards).

e. The program will show the value of users cards and ask if the user wants to hit or stand or split.

NOTE: The value of the two cards is determined by the sum of the value of each card. Face cards have value of 10. Ace would have value of 1 or 11. For example: Ace and Ace have value of 12. Ace and Queen have value of 21. Queen and Jack have value of 20. King and two have value of 12.

f. If the user decides to stand, decide how the program will select a card for the dealer.

g. If the user decides to hit and the total value is less than 21, the program will select a card for the user. If the total value of the users cards is more than 21 during this process, the user will lose; otherwise, decide how the program will select a card for the dealer.

h. If the user decides to split, the dealer will draw two cards for the user. The user now has two hands. Also, an additional bet of equal value to the original bet is placed on the second hand. Proceed the game as in step f and/or g.

i. The winner is determined by the total value of the cards. -If the value of the users cards is more than the dealers cards but less than 21, the user wins. -If the value of the users cards and the dealers cards are the same, the game is a tie. -Otherwise, the dealer wins.

j. - If the user wins, the money inputted will be doubled. -If the user ties, the money inputted will be split in half. -If the user loses, the user win 0 dollars.

k. The program will ask whether the user wants to play again. If so, these steps are repeated. If not, the program displays the total amount of betting money and the total amount won.

l. Be sure to update the players account accordingly

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

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago