Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java must have methods defined (not just main method) in the program In java Design a program to simulate the BlackJack game. Rules: Use

In java

must have methods defined (not just main method) in the program

In java Design a program to simulate the BlackJack game.

Rules:

Use 52-card decks.

Aces is counted as 1 or 11 (depending on the total value of the cards), 2 to 9 according to pip value, and tens and face cards count as ten points.

The value of a hand is the sum of the point values of the individual cards. Please note: if the value is over 21 for the player, aces is counted as 1, otherwise aces is counted 11. The same rule applies to the computer.

A "blackjack" is the highest hand, consisting of an ace and any 10-point card, and it outranks all other 21-point hands.

The dealer will give two cards to the player and two cards to himself (computer).

Deal a card to the player until the player says "no"

Deal a card to the computer as long as the total points of the dealer is less than 17

Once the player says "no more card", check the player's value. If the player bust, the computer wins automatically.

Then check the computer's value. If the computer goes over 21 points, then any player who didn't already bust will win.

If the computer does not bust, then the higher point total between the player and computer will win.

Repeat the game until the player doesn't want to play. Use a new deck for each round.

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 Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

Where those not participating, encouraged to participate?

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago