QuestionQuestion

Blackjack:
Write a program that recreates a game of Blackjack (aka 21). The object of the game is to accumulate cards that add up to 21 without exceeding this total (BUST). Your game should include 2 players and a dealer. The players bet money that the total points in their hand is greater than that of the Dealer (the players should not compete against each other).

Requirements:
1. Include at least (1) EACH of the following:
• If-Else-Else If Statements
• Switch Statement
2. Loops: Include at least (2) DIFFERENT TYPES of loops from the following:
• FOR loop
• WHILE loop
• DO-WHILE loop
3. File Management: Your project should perform at least (1) of the following tasks:
• READ FROM an input file
• WRITE TO an output file
• READ FROM and WRITE TO the same file.
4. Methods
• Include at least (5) Methods throughout your Project.
• Include at least (1) Overloaded Method in your Project.
5. Classes
• Include at least (3) Classes in your Project
• Include at least (1) EACH of the following:
o Class that inherits from another class
o Abstract class
6. Arrays
• Include at least (2) Arrays or ArrayLists
7. Java Libraries
• Import at least (3) Java Libraries (e.g. java.util.Scanner)
8. Exceptions
• Be warned: I AM TRYING TO CRASH YOUR PROGRAM!
• All exceptions should be handled gracefully.
• Include at least (1) Programmer-created Exception.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.util.Scanner;

public class Player{

public final static int HIT = 1;
public final static int STAND = 2;

private BlackjackHand hand;
private boolean playing;
private int money;
private String name;

public Player(String name){
    hand = new BlackjackHand();
    playing = true;
    money = 100;
    this.name = name;
}

public boolean isPlaying(){
    return playing;
}

public void stopPlaying(){
    playing = false;
}

public int valueOfHand(){
    return hand.getBlackjackValue();
}

public int getMoney(){
    return money;
}

public void receiveCard(Card card){
    hand.addCard(card);
}...

By purchasing this solution you'll be able to access the following files:
Solution.java.

$25.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats