Question: You will develop a DiceArray class to be used to implement a dice game class. In the game the user competes against the computer by

You will develop a DiceArray class to be used to implement a dice game class. In the game the user
competes against the computer by rolling 3 die and accumulating points based upon the sum of
the dice rolled. The goal is to see who can accumulate more points, the user or the computer.
The game will consist of 5 rounds. In each round both the user and the computer will take a
turn rolling the dice.
The user gets the first turn. They will roll the dice until one of four things happens:
They have rolled three times
They roll double 1s
They roll triple 1s
They decide not to roll again
The computer gets its turn. The computer will roll the dice until one of three things happens:
It rolls double 1s
It rolls triple 1s
Its total for the turn is 20 or more
If the user/computer rolls double 1s, the user/computer loses all points accumulated for that
turn and the turn is over. If the user/computer rolls triple 1s, the user/computers total points
accumulated for the game is set back to 0 and the turn is over. The player may choose to end
their turn after any roll or choose to continue rolling and risk losing some or all their points.
The points earned during a single round (which could be 0) will be added to their total points,
unless of course they lost all their points by rolling triple 1s!
When the game ends (ie. the 5 rounds are over) your program should determine and display the
game winner or if it was a tie.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!