Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm supposed to make a blackjack game for my CS class and I can't seem to get something to work properly. Basically, after a player

I'm supposed to make a blackjack game for my CS class and I can't seem to get something to work properly. Basically, after a player has taken their turn (And the dealer if the player stays) then the program will ask "Move onto the next player?" which will switch from Player 1 to Player 2, Player 2 to Player 3, and so on. However, after each game, the program asks this no matter if there are no more players left to play, and even if there's only 1 player playing the game. And if the user presses yes, then the game will restart to Player 1 all over again for some reason... This isn't supposed to be an accurate reflection of an actual blackjack game (Like we're not assigning points to cards like face cards are all 10, aces are 11 or 1). We're simply just using a random number generator from 1 to 11. No Blackjacks are included too. I've tried a couple different things but none of them work at all. I don't understand how I can get the program to not ask "Move onto the next player?" once every player has dealt their turn. The coding language is C++

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

1 #include 2 #include 4 using namespace std; 6 int main) { int Numberofplayers0; int o; int k; srand (time (NULL)) cout 4 Numberofplayers 0) f 17 18 19 cout Player Play_Again; while (Player_Play_Again11I Player_Play_Again 0)f cout Player Play_Again; 72 73 else f 75 76 cout Playerscore) t cout 1 Dealer_Play_Again Dealerscore) ( cout 1) { cout 2 #include 4 using namespace std; 6 int main) { int Numberofplayers0; int o; int k; srand (time (NULL)) cout 4 Numberofplayers 0) f 17 18 19 cout Player Play_Again; while (Player_Play_Again11I Player_Play_Again 0)f cout Player Play_Again; 72 73 else f 75 76 cout Playerscore) t cout 1 Dealer_Play_Again Dealerscore) ( cout 1) { cout

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

2. What abilities are possible because humans use symbols?

Answered: 1 week ago

Question

1. How are language and thought related?

Answered: 1 week ago

Question

4. How do rules guide verbal communication?

Answered: 1 week ago