Question: Please solve following JAVA code ASAP, thank you! with a Card class, a CardPile class, a SimpleUI class, fix the BlackjackGame class, use an ArrayList,
Please solve following JAVA code ASAP, thank you!
with a Card class, a CardPile class, a SimpleUI class, fix the BlackjackGame class, use an ArrayList, perform user IO
The game of Simplified Blackjack
Blackjack is the most popular casino gambling game in the world. Note: the rules of the game favour the casino. The Casino is guaranteed to win in the long run.Heres how it works:
Both you and the House the Casinoare dealt two cards: one is face up and the other face down. So you can see only one of the House's cards and it can see only one of yours. But both you and the House can discretely peek at your face down cards.
Each card has a score as follows:
An Ace has a score of This differs from real Blackjack where the Ace can have a score of either or at the player's discretion. The simplified version for this lab is easier to program.
A Jack, Queen or King has a score of
All other cards have a score equal to their rank. For example, the of Hearts or the of any suit have a rank of and a score of
The House will obtain additional cards until its score is or more.
You are asked if you want another card. If you answer yes, you get another face down card and you will asked again. This continues until you say noThis ends the game.
All cards are now turned faceup and the scores of you and the House are calculated.
You lose if your score is more than no matter what the House's score is
You lose if your score is the same as the House's.
You win if:
You don't go over and the House does go over
Both your scores are or under and your score is more than the
House's
The Card class will consist of instance variables, a constructor and the methods. A template for the class is available. The template contains java docs for all the methods. You should generate the html representation of the class to have an easier representation of the class's API Application Programmer InterfaceMany of the methods are only stubs and you have to modify them so that they implement the API.
The template will compile and it has a main method that will run but it produces the wrong output.
Step : Create a Netbeans project and Card class
Create a Netbeans project called Blackjack.
Create a Java file class library typecalled Card with package coelabAll java files in this lab should have that package declaration.
Determine your instance variables and implement the constructor.
Implement the other methods.
Important: Do not continue to the next classes until this class works!
Step : Implement the remaining classes
Templates for the remaining classes are available
You should get the CardPile class to work before proceding. It has its own main method.
You next have to create the BlackjackGame and SimpleUI classes starting with the templates provided. You also have to create an interface UserInterfacecopying the code given below. To create an interface in Netbeans, create a new file and have an interface not a classcreated this file is essential and must not be modified.
Note: All three of these templates have to be loaded in order for them to compile without error.
Notes:
The Card class compareToCard cmethod should return a negative, zero or positive value depending on whether thisis less than, equal to or greater than the other card. For cards of unequal rank, the one with the higher rank is biggerIf the ranks are the same, the suit is considered; the suit orders from lowest to highestare Clubs, Diamonds, Hearts, Spades.
The Card equalsCard cmethod should only return true if the cards have the same suit and rank
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
