Question: Create a client-server blackjack game in java create exactly two classes. One class will act as the functional server. The main method of this server

Create a client-server blackjack game in java create exactly two classes. One class will act as the functional server. The main method of this server will setup the connection on a localhost, find the two clients, let them know which one is Player 1 and which one is Player 2 (depending on the order they connect), and then manage the game as its being played. For each players turn they should start by displaying their current score to the user. Then, the user should be prompted to select whether they want to Hit or Stand. This option selection can be done any way you choose, but invalid entries must be accounted for*. If the player chooses to Hit, the server should deal a card to the player, which will consist of choosing a random number between 1 and 13. The server sends this card to the player, and the player receives the card and adds it to their score. If the card is above a 10, then add a 10 to the players score instead of the original value (In a standard Blackjack game, Jacks, Queens, and Kings still count as 10). After they receive the card or if they choose to Stand, the next player should take their turn. If either player takes a Hit, and the card theyre dealt raises their score total above 21, then the game should immediately end and the other player is the winner (this is known as a Bust). Likewise, if both players choose to Stand, then both players should be shown the final scores and the game is then over. You can not exceed the scope of a console-based application which means no GUIs, etc; you may not allow for more than two players by any means; you may not use two different client classes one client must function as either player

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!