Home / Expert Answers / Computer Science / using-c-programming-in-visual-studio-to-answer-this-question-stage-2-add-code-to-count-how-many-tim-pa965

(Solved): Using C programming in visual studio to answer this question Stage 2 Add code to count how many tim ...



Using C programming in visual studio to answer this question
Stage 2
Add code to count how many times each die face value was rolled. Hint: Use an array in order to store this informatio
Stage 2 Add code to count how many times each die face value was rolled. Hint: Use an array in order to store this information. To define an array in order to count how many times each die face value was rolled: int die_count ; Given that die face values are inclusive, we create an array with seven elements but ignore the zero element of the array. This will make it easier to increment the appropriate array element. That is, die_count[1] should contain the number of that were rolled, die_count[2] the number of rolled, etc. For example: In the example provided in stage 1, the player's hand is assigned the following dice values: . In light of this, the die_count should be as follows: To access and update the appropriate array element (using the value of the die as an index): int die_value = player_hand ; die_count:[die_value] - die_count[die_value] +1 : For example: If die_value is assigned the value 3. Hint: Use a loop in order to count how many times each die face value was rolled. In the example above, this would mean that player_hand[0] would then be player_hand[index] if placed within a loop.


We have an Answer from Expert

View Expert Answer

Expert Answer



Since, there is no mention of stage 1, therefore I will be taking the input from the user. The user will be giving the value of number of times the dice rolled and then a array will be used to collect the input of what value came on each roll.
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe