Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with Java please. Exercise 1: Video Poker Game (80 points) In this assignment, you will develop a simulation of a popular casino game

Need help with Java please.

Exercise 1: Video Poker Game (80 points)

In this assignment, you will develop a simulation of a popular casino game usually called video poker. The card deck contains 52 cards, 13 of each suit. Please design appropriate data structure using Array or ArrayList to represent cards and the card deck. (10 points)

At the beginning of the game, the deck is shuffled. You need to devise a fair method named shuf leCards for shuffling. It does not have to be efficient. (15 points) Also, you need to submit a brief report to describe you implementation of this shuffling algorithm. (5 points)

The player is given 10 tokens at the beginning. The player pays 1 token for each game. Then the top five cards of the deck are presented to the player. The player can reject none, some, or all of the cards, but only once. The rejected cards are removed from the top of the deck. Now the hand is scored. Your program should pronounce it to be one of the following: (10 points)

(1) No pair - The lowest hand, containing five separate cards that do not match up to create any of the hands below. Payout: 0 token

(2) One pair - Two cards of the same value, for example two queens. Payout: 1 token

(3) Two pairs - Tow pairs, for example two queens and two 5's. Payout: 2 tokens

(4) Three of a Kind - Three cards of the same value, for example three queens. Payout: 3 tokens

(5) Straight - Five cards with consecutive values, not necessarily of the same suit, such as 4, 5, 6, 7, and 8. The ace can either precede a 2 or follow a king. Payout: 4 tokens

(6) Flush - Five cards, not necessarily in order, of the same suit. Payout: 5 tokens

(7) Full House - Three of a kind and a pair, for example three queens and two 5's. Payout: 6 tokens

(8) Four of a Kind - Four cards of the same value, such as four queens. Payout: 25 tokens

(9) Straight Flush - A straight and a flush: five cards with consecutive values of the same suit. Payout: 50 tokens

(10) Royal Flush - The best possible hand in poker. A 10, jack, queen, king, and ace, all of the same suit. Payout: 250 tokens

After each game, the player can choose to exit or continue. If the player chooses to continue, you need to ask for 1 token again for the next game. If all of the cards have either used or rejected, you need to put all cards back to the card deck and run the shuffling method again. If the player chooses to exit, you need to show how many games have been played, and what is total number of tokens the player has. If the player has zero token left, the game will automatically exit. (16 points)

Please include all game logic in a class named VideoPoker. Test your implementation of this class using a separate tester class named Ex1. The main method in Ex1 should test all public member methods in VideoPoker class at least once. The last method to be tested in main method is the main launcher of the video poker game. (20 points) Please provide java-doc comments for all member methods and classes that you use in your code (even for class Ex1 and the main method in it). (4 points)

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

More Books

Students also viewed these Databases questions