Problem

In earlier chapters, you created and used a Card class in which each object represents a...

In earlier chapters, you created and used a Card class in which each object represents a playing Card, and in Chapter 8 you constructed a deck of 52 unique Cards. Create a JApplet that uses such a deck. Start the player with a $10 stake. Randomly deal a card to the computer, and allow the player to make one of four bets:

$5 that the player’s card will be higher than the computer’s card

$10 that the player’s card will be higher than the computer’s card

$5 that the player’s card will be lower than the computer’s card

$10 that the player’s card will be lower than the computer’s card

After the player makes a bet, deal the player’s card and add or subtract the correct amount from the player’s winnings based on the results. When the computer’s and player’s cards are the same value, the computer wins. The game ends when the first of these events happens:

The player goes broke (the winnings go to $0 or below).

The player wins $100.

All 52 cards are exhausted without a winner.

As shown in the game in progress in Figure 17-24, when the player is making a bet, enable four betting buttons. After the player makes a bet, disable the betting buttons while the player examines the outcome, and enable an OK button. When the player is ready to resume play and clicks OK, disable the OK button and, if the game isn’t over, enable the four betting buttons. Save the game as JCardBet.java.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT