Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Java

Project: BlackJack

This is an individual project, to be completed on your own. It is considered dishonest either to read someone else's solution or to provide a classmate with a copy of your work. Do not make the mistake of thinking that superficial changes in a program (such as altering comments, changing variable names, or interchanging statements) can be used to avoid detection. If you cannot do the work yourself, it is extremely unlikely that you can succeed in disguising someone else's work. We are adamant that cheating in any form is not tolerated. Even the most trivial assignment is better not done than if you cheat to complete it.

Prerequisites

1. Primitive types
2. Simple arithmetic operations
3. Conditionals
4. Loops
5. Scanner class

Learning Objectives

1. Problem solving
2. Building interactive programs, that is, getting input from the user
3. Using conditionals and loops to guide the program behavior

Introduction

In this project you will simulate a game of BlackJack. You will implement the logic for a round; you will also provide the user with the option to play another round or exit the game.

Game Rules

Blackjack, also known as 21, is a very popular casino game between a player and a dealer. It is played with a deck of 52 cards. For this project, we will consider the simplest version of the game.

The goal of the game is for the player to obtain a hand of cards that beats the dealer in one of the following ways:

1. Get 21 points on the first two cards, this is called a BlackJack. Note that if the dealer gets a BlackJack (21) on the first two cards, no matter what, the dealer wins.

2. Reach a final score higher than the dealer without exceeding 21

3. Let the dealer draw additional cards until her hand exceeds 21

At the beginning of the game, the player is dealt two cards and the dealer takes two cards. The value of their cards are added together to update each of their scores. Face cards (King, Queen and Jack) are counted as 10 points. Ace cards are counted as 11 and any other cards are counted as the numeric value shown on the card. If the player scores 21 on the first two cards, and the dealer doesn't, he gets a BlackJack and immediately wins. If the dealer gets a BlackJack, the player loses, no matter the score.

After receiving their first two cards, if the game continues, the player has the option of getting additional cards, one by one, which is called a hit. If the player scores higher than 21 at any given point is called a bust and results in an immediate loss. Every time the player hits, the dealer must also hit, unless her total score is 17 or more. Once the dealer reaches or exceeds 17, she can't take any more cards.

Once the player has decided he doesn't want to hit anymore, the round has ended. The player wins by not busting and having a total higher than the dealer's. The dealer loses by busting at the end of the round or having a lesser hand than the player who has not busted. If the player and dealer have the same total, this is called a push and it is considered a tie.

Discussion: From description to code

The rules of Blackjack were explained in the previous section. But now, how to go from the description of the rules to a Java program? As this is your very first project, we will give you some help.

From the Blackjack description, we know that we need to represent in Java two "objects", that is:

1. a card, that represents a single card in a 52 deck.
2. the deck of 52 cards.

Attachment:- Java_Project_BlackJack.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M91869709
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in Java

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As