Need help? We are here

# 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

### Define and briefly describe the different classes of microorganisms (including

Define and briefly describe the different classes of microorganisms (including the terms Eukaryotes and Prokaryotes):   Eukaryotes – Algae – Fungi – Protozoans –    Prokaryotes –

UCR PERFORMANCE TASK UCR Performance Task Scenario In June of 2016, you begin your first week as an intern at the Happy Town Police

### Conducting research with strong ethical principles is a critical component

Conducting research with strong ethical principles is a critical component of being an effective nurse researcher. Consider all or some of these questions as you

### Listen to the lecture on Imperial Ambitions and Sectional Crises from 18421861 and submit your lecture notes by Friday November

Listen to the lecture on Imperial Ambitions and Sectional Crises from 1842-1861 and submit your lecture notes by Friday, November 20 at midnight.Also, read Chapter

### SCM 620 – Strategic Sourcing Case Analysis

A Framework for Analyzing Supply Chain Management Cases (See the Case Information file posted in Blackboard pages 1 – 17 for further detail)   Step

### Instructions Choose one of the scenarios below A or B to complete the assignment. Scenario A You are the business

InstructionsChoose one of the scenarios below (A or B) to complete the assignment.Scenario AYou are the business owner of a local small engine repair shop,

### Innovations in Context Essay

Innovations in Context Essay Given the ….School of Engineering Mission Statement, for your final essay you’ll be asked to write about an innovation. But first,

### LPN position in Family Medicine

1. It was very nice meeting with you and learning more about the LPN position in Family Medicine that you have interviewed me for. I

### Part 1 (300 words for each part and references) Put together

Part 1 (300 words for each part and references) Put together a structured focus group of 3 people who have the  recent purchase of a

### Below is the question-    DUE Thursday Use this online discussion to share

Below is the question-    DUE Thursday Use this online discussion to share ideas about the assigned text. Consider the prompts below. Relate concepts in

### One of the first marketing plans you will develop will

One of the first marketing plans you will develop will be to market your personal brand. A personal brand is how you want to be

### SELECT one of the following topics: Gun Control the Death Penalty or Abortion. COMPOSE a persuasive argument pursuant based upon

SELECT one of the following topics: Gun Control, the Death Penalty, or Abortion.COMPOSE a persuasive argument pursuant based upon your position on the selected topic.

New questions

### 1)After working with your preceptor to assess organizational Nursing Assignment Help

1)After working with your preceptor to assess organizational policies, create a list of measurable outcomes for your capstone project intervention. Write a list of three

### Consider all that you have learned about hearing, hearing Nursing Assignment Help

Consider all that you have learned about hearing, hearing loss, hearing assessment, and ways to manage hearing loss in what you have read, researched, watched,

### Please write a paper 4-6 (max of 6 pages) with the following

Please write a paper 4-6 (max of 6 pages) with the following topic: NURSING INTERVENTIONS AMONG OLDER ADULTS TO REDUCE CAUTIS( CATHETER-ASSOCIATED URINARY TRACT INFECTION)

### Research Study Participants, Procedures, and the

Research Study Participants, Procedures, and the Instrument(s)[WLOs: 1, 2] [CLOs: 4, 6] Prior to beginning work on this assignment, review Chapters 13 through 17 from

### PU Headache Migraine with Toxic Exposure Risk Activity

I’m working on a health & medical discussion question and need guidance to help me learn. Please add your own opinion and review the following