Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- A game is made up of rounds, a single round is played as such: Game Description There is a single player, with four (four

image text in transcribed

- A game is made up of rounds, a single round is played as such:

Game Description There is a single player, with four (four sided) dice The sides of each die are labeled with the numbers from 1 to 4, the number on the side facing down will used as the value of the die. A game is made up of rounds, a single round is played as such 1. The player rolls their four dice: d1 = (int) (Math.random () * 4) + 1; d2 (int) (Math.random () * 4) + 1 d3 = (int) (Math.random () * 4) + 1 d4 = (int) (Math.random () * 4) + 1 d1, d2, d3, d4 declared as type int before the game loop. 2. The dice are displayed, in some reasonable format. 3. A determination is made as to whether or not the player has won the round. The player loses the round unless they have one of the following: A Quad: all the dice have the same number on their bottom faces A Straight: the numbers on the dice bottom faces can be arranged to form the consecutive sequence: 1 2 3 4 A Triple all but one of the dice have the same number on their bottom faces A TwoPair: two dice have the same number on their bottom faces, and both of the remain ing dice also have the same number on their bottom faces - which is distinct from the value of the first pair of dice A HighPair is when (exactly) two dice have the number 4 on their bottom faces, and exactly) one of the remaining dice has the number 3 on its bottom face 4. The result of the round (with respect to the Player) is reported. The player is asked if they wish to play another round Once the player indicates that they do not wish to play another round: Before exiting, the program displays a short report stating how many rounds were played, of those - how many were won and how many were lost

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago

Question

What tools might be helpful?

Answered: 1 week ago