Write a C program that allows a single Player (the user) to play a simple three...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C program that allows a single Player (the user) to play a simple three dice game of chance against "The Odds". 1. There is a single player, with three eight sided dice. 2. The sides of each die are labeled with the numbers from 1 to 8, we will call this the value of the die. 3. A game is made up of rounds, a single round is played as such: a) The player rolls their three dice b) The dice are displayed, in some reasonable format. c) A determination is made as to whether or not the player won the round, this determination is made via the following rules: i. A Triple is when all the dice have the same number on their top faces. If the player has any Triple then they win the round. ii. A Straight is when the numbers on the three dice faces can be arranged to form a consecutive sequence like 1 2 3 or 3 4 5 If the player has any Straight then they win the round. iii. A Pair is when any (exactly) two dice have the same number on their top faces. If the player has any Pair then they neither win nor lose the round. iv. A Junker is then anything that is not a Triple, a Straight or a Pair. If the player has any Junker then they lose the round. d) The result of the round (with respect to the Player) is reported. 4. The player is asked if they wish to play another round. 5. 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. Write a C program that allows a single Player (the user) to play a simple three dice game of chance against "The Odds". 1. There is a single player, with three eight sided dice. 2. The sides of each die are labeled with the numbers from 1 to 8, we will call this the value of the die. 3. A game is made up of rounds, a single round is played as such: a) The player rolls their three dice b) The dice are displayed, in some reasonable format. c) A determination is made as to whether or not the player won the round, this determination is made via the following rules: i. A Triple is when all the dice have the same number on their top faces. If the player has any Triple then they win the round. ii. A Straight is when the numbers on the three dice faces can be arranged to form a consecutive sequence like 1 2 3 or 3 4 5 If the player has any Straight then they win the round. iii. A Pair is when any (exactly) two dice have the same number on their top faces. If the player has any Pair then they neither win nor lose the round. iv. A Junker is then anything that is not a Triple, a Straight or a Pair. If the player has any Junker then they lose the round. d) The result of the round (with respect to the Player) is reported. 4. The player is asked if they wish to play another round. 5. 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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these computer network questions
-
Commercial Bank and Trust Company is studying the use of its automatic teller machines (ATMs). Of particular interest is whether young adults (under 25 years) use the machines more than senior...
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
Air Asia is pursuing a strategy to become a "retailer" of travel/tourism services, selling more than airline products. 1. What is the reason behind this? 2. the pros and cons? What are other similar...
-
What is an ion and what are the two varieties?
-
An all-equity firm is considering the following projects: The T-bill rate is 4 percent, and the expected return on the market is 11 percent. a. Which projects have a higher expected return than the...
-
Which of the following items could cause the recognition of accrued liabilities? (a) Sales, interest expense, rent. (b) Sales, taxes, interest income. (c) Salaries, rent, insurance. (d) Salaries,...
-
Heat conduction in a nuclear fuel rod assembly (Fig. 10B.3) considers a long cylindrical nuclear fuel rod, surrounded by an annular layer of aluminum cladding. Within the fuel rod heat is produced by...
-
The Alpine House, Incorporated, is a large retailer of snow skis. The company assembled the information shown below for the quarter ended March 31: Sales Selling price per pair of skis Variable...
-
Horla Co's manufacturing operations recorded the following information for the month of March 20x9: Inventories Mar. 1, 20x9 Mar. 31 20x9 Direct materials $38,500 $28,750 Work in process $21,750...
-
Discuss whether men and women communicate differently.
-
Define active listening.
-
Thanks a lot. Can this phrase mean more than one thing? Explain why.
-
Starbucks has said its goal is to expand delivery to one-quarter of its US stores and increase earnings per share by 10 percent. How will the organizing function contribute to the accomplishment of...
-
Headquartered in Boulogne-Billancourt, France, the automotive manufacturer Renault was established 120 years ago in 1899, and Japanese automotive manufacturer, Nissan, was founded in 1933,...
-
Describe the interface between the project manager and functional manager. Describe where you believe your organization/project is in this cycle. a. Authority b. Project Success c. Management of...
-
Distinguish among total-moisture content, free-moisture content, equilibrium-moisture content, unbound moisture, and bound moisture.
-
We seek to find the path \(y(x)\) that minimizes the integral \(I=\int f\left(x, y, y^{\prime}ight) d x\). Find Euler's equation for \(y(x)\) for each of the following integrands \(f\), and then find...
-
Find a differential equation obeyed by geodesics in a plane using polar coordinates \(r, \theta\). Integrate the equation and show that the solutions are straight lines.
-
Find two first-order differential equations obeyed by geodesics in threedimensional Euclidean space, using spherical coordinates \(r, \theta, \varphi\).
Study smarter with the SolutionInn App