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

Homeostasis Please explain and discuss the physiology of a faster

  Homeostasis Please explain and discuss the physiology of a faster heart rate with a reduced blood volume and how it relates to homeostasis and feedback mechanisms. 1. Your original post must have a clear understanding of the topic and should be a minimum of 1 paragraph with at least 5

Clinical Trials – Premium Paper Help

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 with research materials for assistance purposes only. All the materials from our website should be used with proper references.

1. (2 pts) How are the U.S. interstate highways numbered?

  1. (2 pts) How are the U.S. interstate highways numbered? (hint: from west to east, south to north, even/odd, descending/ascending order)? What’s the one/two/three-digit system? Is the interstate highway number unique, meaning there is only one number in one place?2. (0.5 pt) Enumerate four functional classifications of highways.3. (0.5

A controversial issue is one which results in dispute and

A controversial issue is one which results in dispute and disagreement due to a difference of opinion, much like the issues you will do each week for homework. The difference is, you will choose a topic that you are interested in. You must submit a scenario or topic and defend

Survey about the challenges of Wireless Body Area Networks

The report must include the following (with each section roughly one third of the total report): Background, history and applications of the assigned topic or technology An overview of the architecture or solution and current standards for the assigned topics or technology At least one case study of the application

300 words What are the key factors that need to

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 with research materials for assistance purposes only. All the materials from our website should be used with proper references.

**Write FOUR 100-word replies to the 4 individual questions below.**

**Write FOUR 100-word replies to the 4 individual questions below.** Use APA formatting and citation standards.  Four questions equal four separate responses.  The primary post(s) are provided as an attached file.   Assignment Details:  To help you with your discussion, please consider the following questions:   What clarification do you need regarding

The past few weeks have flown by. You have just

  The past few weeks have flown by. You have just completed the GA tutorial when you receive a memo from Ying marked CONFIDENTIAL. You scan the memo to find a list of client questions that have been assigned to you. You are expected to use Google Analytics to answer

Instructions Read the Assignment Instructions Complete the Nursing Assignment Help

Instructions  Read the Assignment Instructions Complete the projects by following the directions in your text as detailed in the assignment instructions. Submit the completed document for the assignment using the "Add Attachments" button. Learn more about Assignment features, review Assignment Help Read the Assignment Instructions Complete the projects by following

Bermain Poker Online Dengan Poly Strategi Jitu di dalam sini

  Bermain Poker Online Dengan Poly Strategi Jitu di dalam sini sudah sempurna semuanya pemain pula bisa pakai satu taktik yg terhebat diana untuk dapat peroleh majemuk keuntungan dalam jumlah banyak dan uang pada jumlah yg tidak sedikit pastinya. buat semuanya permainan Game Judi On-line sudah absolut juga akan beri

In addition to one initial post, respond to at least

In addition to one initial post, respond to at least one peer. Initial Post Length: minimum of 200 words. Secondary Post Length: minimum of 150 words per post. Using APA format, incorporate appropriate in-text citation(s) and corresponding references page for the initial post. How have explanations of abnormal behavior changed

 Considering the diversity in state government leadership and the various ethical issues associated with human subjects research, describe what your

 Considering the diversity in state government leadership and the various ethical issues associated with human subjects research, describe what your target sample subjects might perceive as the risks for participating in your study. Briefly describe the following: Your targeted sample The anticipated risks from the subject’s perspective Your strategies for

: While reading a news article on your favorite athletic

: While reading a news article on your favorite athletic shoes, you are surprised to learn the company uses child labor in Pakistan. Living in the United States, it is hard to imagine children working in factories. What is child labor? According to the International Labor Organization, child labor is

Assignment 1: Genre Analysis Q- What do you get when you rewind a

Length: 1,000-2,000 words So far in this class, we have discussed the concept of the discourse communities and genre/genre analysis (see articles from 1/31). For this assignment, you will write a genre analysis that analyzes a genre you have a high degree of familiarity with. Steps for analysis 1. Collect