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.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Subordinate Support Assignment Instructions Overview This assignment provides you with

 Subordinate Support Assignment Instructions Overview This assignment provides you with the opportunity tofurther analyze the organization that you selected back in Module 3: Week 3,from a leadership perspective. This assignment will enable you to gain a deeperunderstanding of how this organization supports subordinates through effectiveleadership. Instructions   In this assignment,

The monetary system in any economy facilitates trade and allows

 The monetary system in any economy facilitates trade and allows people to trade more efficiently, as compared to a barter economy. In the United States, the monetary authority is the Federal Reserve System (also referred to as the Federal Reserve, or informally, as the “Fed”.)  For this assignment, use the

Research paper on an aspect of evolving technology in the electrical

Write a 4 page research paper on an aspect of evolving technology in the electrical industry. At the time you enter the industry, and throughout your carrier, the role of green energy solutions, renewable energy, power distribution, lighting controls, LED and other efficient lighting methods, intuitive switch gears and countless

Activity 11 assignment For this assignment, you should access the

Activity 11 assignment For this assignment, you should access the C-roads World Climate simulator (either online or downloaded to your computer).  This can be found at: https://www.climateinteractive.org/tools/c-roads/ On the site listed above, you will have the option to download the simulator or use the online option. I chose to download

Be prepared to discuss the following: What types of resources

Be prepared to discuss the following: What types of resources are available to communities in terms of learning about nutrition and healthy eating? What types of resources are available to global populations in terms of learning about nutrition and healthy eating? What are three challenges communities and global populations have

Paper #1: Analysis of a 10-K Relating to Segment and

Paper #1: Analysis of a 10-K Relating to Segment and NCI Reporting & Disclosures  1. Locate Procter & Gamble SEC 10-K from the SEC website (www.sec.gov).  2. Explore the concepts of segment and NCI disclosure and reporting using course resources. You must also find and review / read outside literature

Describe global patterns of atmospheric heating and circulation. What mechanisms

Describe global patterns of atmospheric heating and circulation.  What mechanisms produce high precipitation in the tropics? What mechanisms produce high precipitation at temperate latitudes?  What mechanisms produce low precipitation in the tropics?Use w atmospheric circulation and seasonal changes in the sun’s orientation to earth to explain the highly seasonal rainfall

This week you will choose your organization and learn about

This week you will choose your organization and learn about its corporate values. Review Strategic Management – 12 Most Popular Cases in Connect. Access the case studies from the folder on the main course page in Blackboard. Choose one of the organizations to use for all weekly assessments. You will not

Ethic responsibility Critical thinking

 Description At the undergraduate-level university experience, there have been few activities that can be more beneficial to reading and individual reflection to determine student success. It is so important that you keep up with readings and employ strong reading skills. At two points within the course, you will be expected

We are focusing on access control. Do some Internet research

We are focusing on access control. Do some Internet research to identify what some people consider the most secure buildings in the world. These might be military, political, financial, religious, or some other purpose. Pick one location and describe the location, its security protections, and how people are authenticated and

Present your original research findings, analysis and links to your

 Present  your original research findings, analysis and links to your relevant references, literature citations, and the applied theories.    ​(What does data collection say about juveniles ,Personal experiences and encounters)Include charts and statistics be sure to include where you got the sources from.Down below I will insert the proposal when

Directions: Choose a sport you want to do research on.

Directions:  Choose a sport you want to do research on.  Fill out the information below its specific  each question, and include at least 2 sources where you found your information as well.  This is a college level assignment so I expect you to write LOTS of specific information to illustrate

Alex is having his first session with a counselor and

 Alex is having his first session with a counselor and is recounting his life history:I’ve just turned 20. I finished high school about two years ago, and I have been lost since then. I was diagnosed with attention deficit hyperactivity disorder when I was five, and it has been a

JEAN WATSON and his/her theory.

 Within a small group, together select a nursing theorist from the list below and explore the work of th JEAN WATSON and his/her theory. Nursing Theorists Guidelines: 1. Intro that includes: Credentials and background of the theorist. (3/4 of a page max) 2. Type of theory/focus — (based on the

Policy Memo: Domestic Politics and International Cooperation

The policy memo will be addressed to a client—a head of a government agency or international institution, or a policy strategist at a firm or NGO—and will briefly summarize the state of play of existing policy, outline the policy options, and explain how to choose among them. The idea behind