# 6.19 Program #2: Poker dice game Program Specifications Write a

## 6.19 Program #2: Poker dice game

Program Specifications Write a program to calculate the score from a throw of five dice. Scores are assigned to different categories for singles, three of a kind, four of a kind, five of a kind, full house, and straight. Follow each step to gradually complete all methods.

Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.

Step 0. Review the provided main() method. Five integer values are input and inserted into an array. The array is sorted and passed to findHighScore() to determine the highest scoring category. Make no changes to main(). Stubs are provided for all remaining methods.

Step 1 (3 pts). Complete the checkSingles() method. Return the sum of all values that match parameter goal. Update the findHighScore() method to use a loop to call checkSingles() six times with parameters of 1 – 6. Return the highest score from all method calls. Submit for grading to confirm two tests pass.

Ex: If input is:

2 4 1 5 4

the output is:

High score: 8

Step 2 (3 pts). Complete the checkThreeOfKind(), checkFourOfKind(), and checkFiveOfKind() methods. Hint: Since the values are in ascending order, same values are stored in consecutive index locations. Return 30 from checkThreeOfKind() if the dice contain at least three of the same values. Ex: (2, 3, 3, 3, 6). Return 40 from checkFourOfKind() if the dice contain at least four of the same values. Ex: (4, 4, 4, 4, 5). Return 50 from checkFiveOfKind() if the dice contain five identical values. Ex: (5, 5, 5, 5, 5). Update the findHighScore() method to call the three methods and return the highest score from all method calls. Submit for grading to confirm five tests pass.

Ex: If input is:

2 4 4 5 4

the output is:

High score: 30

Step 3 (2 pts). Complete the checkFullHouse() method to return 35 if the dice contain a full house (a pair and three of a kind). Ex: (1, 1, 3, 3, 3). Note: Five of a kind also satisfies the definition of a full house since (4, 4, 4, 4, 4) includes a pair of 4s and three 4s. Update the findHighScore() method to call checkFullHouse() and return the highest score from all method calls. Submit for grading to confirm seven tests pass.

Step 4 (2 pts). Complete the checkStraight() method to return 45 if the dice contain a straight of (1, 2, 3, 4, 5) or (2, 3, 4, 5, 6). Update the findHighScore() method to call checkStraight() and return the highest score from all method calls. Submit for grading to confirm all tests pass.

I need help making this code, I could only do checkSingles(). Please help.

Pages (275 words)
Standard price: \$0.00

### Latest Reviews

Impressed with the sample above? Wait there is more

Related Questions

### Describe the actions as an engineer that should be taken to come to

• Explain how ethical lapses contributed to the engineering failure. • Describe the actions as an engineer that should be taken to come to grips

### Requirements: Provide a 500 word (or 2 pages double spaced)

Requirements:     Provide a 500 word (or 2 pages double spaced) minimum reflection.   Use  of proper APA formatting and citations. If supporting evidence from  outside resources is

### Describe the current health status of this group. How do race and ethnicity influence health for this group?

Select an ethnic minority group that is represented in the United States (American Indian/Alaskan Native, Asian American, Black/African American, Hispanic/Latino, Native Hawaiian, or Pacific Islander).

### The a-s-s-e-s-s-m-e-n-t will be 1400 – 1600 words long. Please

The a-s-s-e-s-s-m-e-n-t will be 1400 – 1600 words long. Please see the questions shown in the screenshot. I will send you all info after hired,

### Video Assignment: How will it affect the way you experience the

In this assignment you will learn more about a specific aspect of theatrical production. In the “videos” content section you will find five folders. Please

### Develop three examples that illustrate how a manufacturing company or

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along

### CASE- ALEXIA Last week, Alexia entered the inpatient treatment program

CASE- ALEXIA Last week, Alexia entered the inpatient treatment program where you are a social worker. She is being treated for alcohol and cocaine

### Redistricting in Texas has been an issue of significant controversy

Redistricting in Texas has been an issue of significant controversy since 2000 ( and even before but not as dramatic and consequential).  First read some

### Please complete the following questions. Use a word processor to

Please complete the following questions. Use a word processor to complete your work. Remember to use complete sentences and include both the questions and answers

### For the writing assignment, I give you a policy issue

For the writing assignment, I give you a policy issue or situation that you are asked to comment on using economic analysis. You may submit

### Research Google’s corporate culture and respond to the following: Do

Research Google’s corporate culture and respond to the following: Do you think Google’s unique culture will help or hurt Google in the long run? Please

### Assignment: Denial of Service ToolsLearning Objectives and OutcomesDifferentiate between tools

Assignment: Denial of Service ToolsLearning Objectives and Outcomes<li”>Differentiate between tools that are used to create a denial of service (DoS) attack.Assignment Requirements You have recently

New questions