support@homeworkmarkettutors.com

Call toll free: +1 (304) 900-6229 or Request a call

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

Written assignment. Imagine you are about to hire a new worker or

Written assignment. Imagine you are about to hire a new worker or workers for your organization.  Prepare an APA formatted 4-5 pages paper (with a minimum of six [6] peer-reviewed sources):   · Based on the information in this chapter (attached in the other file), what screening questions would you include

1. Top of Form Many people in the US, particularly the elderly, take

1. Top of Form Many people in the US, particularly the elderly, take more than one prescribed medication. CDC (2014) reported that between 2009 and 2012 nearly 48% of persons asked used at least one prescription drug, 22% used three or more prescription drugs, and nearly 11% used five or

For each DQ elaborate within 260-300 words for each. Use in-text

For each DQ elaborate within 260-300 words for each. Use in-text citations accordingly. Use scholarly reference(s). Use and cite references using APA 7th Style Guide accordingly. Don’t combine DQs together. Topic 1: Job/Task Analysis and Evaluation DQ 1) Aamodt (2022) in Industrial/Organizational Psychology: An Applied Approach discusses the importance of job analysis

Mini-Literature Review – Pt 1 Read the introduction of low-carbon

Mini-Literature Review – Pt 1 Read the introduction of low-carbon development opportunities using the abatement cost approach – Marginal Abatement Cost Curve (MACC): Then, find five additional articles (i.e., peer-reviewed journal articles) related to your proposed topic.  (my proposed topic is to qualify or quantify the low-carbon development opportunities using

SCI 100 Module Six Activity Template: Science in the Real

SCI 100 Module Six Activity Template: Science in the Real World Instructions First, choose one video from the module resources to watch. You should use points made in the video you chose, and any other course resources, to support your responses to the questions below. Replace the bracketed text with

5 Proposal on Assessment of Needs of Clients

5 Proposal on Assessment of Needs of Clients Student’s Name Institutional Affiliation Course Name Instructor’s Name Date Proposal on Assessment of Needs of Clients The suggested initiative will investigate women suffering from postpartum depression’s necessities and formulate a plan of action for their well-being. This research will study postpartum depressive

For each DQ elaborate within 260-300 words for each. Use in-text

For each DQ elaborate within 260-300 words for each. Use in-text citations accordingly. Use scholarly reference(s). Use and cite references using APA 7th Style Guide accordingly. Don’t combine DQs together. Topic 1: Job/Task Analysis and Evaluation DQ 1) Aamodt (2022) in Industrial/Organizational Psychology: An Applied Approach discusses the importance of job analysis

FON241LL Lesson 4 Lab

FON241LL Lesson 4 Lab Diet Analysis & Health Assessment 1. What is your average percentage of total kcalories from carbohydrate? (See Macronutrient Bar Graph) (5 pts) 2. What are the dietary guidelines for percent of total kcalories from carbohydrate? Did you meet this range? (5 pts) 3. According to the

Instructions: Due Tuesday 02/6 At least 3 paragraphs long with 3

Instructions: Due Tuesday 02/6 At least 3 paragraphs long with 3 peer-reviewed references. No textbook sources Explain the potential problem that could arise from using ROI as the incentive measure for managers. What are some specific actions a company might take to resolve this potential problem? #Instructions #Due #Tuesday #026At

Instructions: Due Tuesday 02/7 At least 3 paragraphs long with 3

Instructions: Due Tuesday 02/7 At least 3 paragraphs long with 3 peer-reviewed references. No textbook sources What does the direct materials quantity variance measure? Who is generally responsible for the direct materials quantity variance? Describe two situations that could result in a favorable direct materials quantity variance. Describe two situations

Discussion on Integrating Sources in APA

Discussion on Integrating Sources in APA Instructions: Write a few sentences (120 words) integrating a quote from any of the articles that you will be using in your paper. ( Will post the articles as pdf). Be sure to connect your quote to the rest of your sentences. You can

Chapter 4 Do you believe the media should be censored to protect

Chapter 4 Do you believe the media should be censored to protect Homeland Security? What if the news media got a hold of sensitive information as it pertained to an investigation into a potential terror attack and, by releasing that information to the public, it could hinder and prevent the

NATIONAL ORGANIZATION OF NURSE PRACTITIONER FACULTIES (NONPF)

NATIONAL ORGANIZATION OF NURSE PRACTITIONER FACULTIES (NONPF) COMPETENCIES The National Organization of Nurse Practitioner Faculties (NONPF) has determined nine broad areas of core competence that app #NATIONAL #ORGANIZATION #NURSE #PRACTITIONER #FACULTIES #NONPF