Question: Write a program to calculate the score from a throw of five dice. Scores are assigned to different categories: for five of a kind, straight,
Write a program to calculate the score from a throw of five dice. Scores are assigned to different categories: for "five of a kind", "straight", and "chance".
Your program must include the following functions. Each function must take one parameter, an array of integers, that represents the numbers on the five dice cast values can be through
chance returns the sum of the dice
fiveOfKind returns if all five dice are the same value otherwise
straight returns for or otherwise
isSorted returns true if the dice values are in sorted order each value is less than or equal to the next value in the array otherwise false. This function should return a bool value true or false See section for more information about the Boolean data type.
The main program should ask the user to enter the dice values in ascending sorted order. If the input values are not in increasing, order, output the error message: "Error: not in increasing order". If the values are in increasing order, then the program should call the three functions to see which one returns the highest value, and output that value as the Highest Score.
Ex: If input is:
the output is:
High score:
Ex: If input is:
the output is:
Error: not in increasing order
Ex: If input is:
the output is:
High score:
Follow the Style Guidelines especially function header comments
Do not use vectors! c
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
