# 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.

Pages (275 words)
Standard price: \$0.00

### Latest Reviews

Impressed with the sample above? Wait there is more

Related Questions

### Use the Web to search for “incident response training” and

Use the Web to search for “incident response training” and identify one company that offers such training. Look at the course offerings then write a

### For this final report assignment, you can use the same

For this final report assignment, you can  use the same industry you selected for the Week 3 assignment, or you  can select another industry.  Prepare

### Discuss the following: 1. Discuss blockchain’s potential application in compensation

Discuss the following: 1. Discuss blockchain’s potential application in compensation systems (base wages, incentives, rewards). 2. How can a token economy affect employee compensation? You

### You will submit a market analysis to JGJ, Inc. of

You will submit a market analysis to JGJ, Inc. of 1000 words (+/- 50 words) using at least 4 credible and objective sources not

### In the context of Chapter 1, vignette “Thinking Like a

In the context of Chapter 1, vignette “Thinking Like a Criminologist” (by the end of the section on “Ethical Issues in Criminology), is it fair

### Instructions Create a job description and a 90-day plan of work

Instructions Create a job description and a 90-day plan of work for a newly hired labor relations specialist.  This job description should outline the job

### Scenario You have recently been hired as a lead consultant

Scenario You have recently been hired as a lead consultant for the University Medical Center. You have been working with the quality team and

### write a one-page critique for each article using the American

write a one-page critique for each article using the American Psychological Association (APA) format.   The following journals are good possible sources that are relevant

### Compare “The Star-Spangled Banner,” the current US National Anthem, to

Compare “The Star-Spangled Banner,” the current US National Anthem, to “Life Every Voice,” a song that has been discussed as a possible replacement for it.

### What is your role as a nurse in protecting patient

What is your role as a nurse in protecting patient healthcare information? instructions:  at least 350 words.      All answers or discussions comments submitted must be

### Please Review and use for references: https://www.amstat.org/ASA/Your-Career/Ethical-Guidelines-for-Statistical-Practice.aspx https://careersinpsychology.org/choosing-to-focus-on-research-as-a-psychologist/ Article 1

Please Review and use for references: https://www.amstat.org/ASA/Your-Career/Ethical-Guidelines-for-Statistical-Practice.aspx https://careersinpsychology.org/choosing-to-focus-on-research-as-a-psychologist/ Article 1 Ch. 5 text As your required text suggests, research is not only for those in

New questions