Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please make the blackjack 21 card game in JAVA: Make two classes: BlackJackMain and BlackJackMethods. In BlackJackMain class, write a program which will ask the

Please make the blackjack 21 card game in JAVA: Make two classes: BlackJackMain and BlackJackMethods. In BlackJackMain class, write a program which will ask the user if they have ever played this game before. If the user says no, ask them to create a username and password and filewrite it. -The password must be at least 6 characters long -must contain at least one capital letter -must contain at least one lower case letter -and must contain at least 1 number If user says yes, ask them for their username and password. FileRead it to check if the username or password they have entered matches with what is in the file. If it matches, let them play the game. If not, then give them 3 extra tries to enter the password. If they still fail to login, end the program by saying "You have failed to login". Once they are allowed in, start the game off by giving the user $100 and asking them how much they want to bet. for instance, if the user says 50. Then start the game by giving player 1 (the user) receive two cards and player 2 (the dealer and played by the computer) two cards also. Give the player the option to either hit or stand. The first player may take one more card, then one more, trying to get as close to 21 total as possible. When the first player stops taking cards, the second player takes cards to get closer to 21. If either player goes over 21, they lose immediately. If both players stay under 21, the player with the higher total wins. At the beginning, if a player has 21 in two cards, that is "Black Jack" and they win immediately. The totals are added-up as follows: Cards 2-10 count their face value (rank). Face cards (king, queen, jack) count 10. An ace counts either 11 or 1, depending on which is better for the player.

Examples:

10 , 8 --> 18

Jack, Queen --> 20

Ace , 6 --> either 7 or 17

Queen , Ace --> Black-Jack (win)

Queen , 5 , 8 --> 23 (busted = lose)

In BlackJackMethods have all the methods necessary to run the game. You can add some things to the BlackJackMain class as well if need to.

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

mple 10. Determine d dx S 0 t dt.

Answered: 1 week ago