Question: in c + + 2 3 . 1 0 LAB * : Program: Poker dice game Program Specifications Write a program to calculate the score
in c
LAB: Program: 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 functions.
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 Review the provided main function. Five integer values are input and inserted into a vector. The vector is sorted and passed to FindHighScore to determine the highest scoring category. Make no changes to main Stubs are provided for all remaining functions.
Step pts Complete the CheckSingles function. Return the sum of all values that match parameter goal. Update the FindHighScore function using a loop to call CheckSingles six times with parameters being Return the highest score from all function calls. Submit for grading to confirm two tests pass.
Ex: If input is:
the output is:
High score:
Step pts Complete the CheckThreeOfKind CheckFourOfKind and CheckFiveOfKind functions. Hint: Since the values are in ascending order, same values are stored in consecutive index locations. Return from CheckThreeOfKind if the dice contain at least three of the same values. Ex: Return from CheckFourOfKind if the dice contain at least four of the same values. Ex: Return from CheckFiveOfKind if the dice contain five identical values. Ex: Update the FindHighScore function to call the three functions and return the highest score from all function calls. Submit for grading to confirm five tests pass.
Ex: If input is:
the output is:
High score:
Step pts Complete the CheckFullHouse function to return if the dice contain a full house a pair and three of a kind Ex: Note: Five of a kind also satisfies the definition of a full house since includes a pair of s and three s Update the FindHighScore function to call CheckFullHouse and return the highest score from all function calls. Submit for grading to confirm seven tests pass.
Step pts Complete the CheckStraight function to return if the dice contain a straight of or Update the FindHighScore function to call CheckStraight and return the highest score from all function calls. Submit for grading to confirm all tests pass.
follow this code:
#include
#include
using namespace std;
Add all occurences of goal value
int CheckSinglesvector& diceValues, int goal
Complete the function and update the return statement
return ;
Check for three of a kind score
int CheckThreeOfKindvector& diceValues
Complete the function and update the return statement
return ;
Check for four of a kind score
int CheckFourOfKindvector& diceValues
Complete the function and update the return statement
return ;
Check for five of a kind score
int CheckFiveOfKindvector& diceValues
Complete the function and update the return statement
return ;
Check for full house score
int CheckFullHousevector& diceValues
Complete the function and update the return statement
return ;
Check for straight score
int CheckStraightvector& diceValues
Complete the function and update the return statement
return ;
Find high score
int FindHighScorevector& diceValues
Complete the function and update the return statement
return ;
int main
vector diceValues;
int highScore ;
Fill array with five values from input
forint i ; i ; i
cin diceValues.ati;
Place values in ascending order
sortdiceValuesbegin diceValues.end;
Find high score and output
highScore FindHighScorediceValues;
cout "High score: highScore endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
