Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ (Please read carefully the instruction and do not copy of other answers) ** The code should be written in only C++** And the ouput

C++ (Please read carefully the instruction and do not copy of other answers)

** The code should be written in only C++**

And the ouput of the code should be exactly like the output in the below instruction. Thanks,

image text in transcribedimage text in transcribed

Problem A: Dice game (20 points) Suppose you have a game where you roll two dice, that follow these rules: Roll 1-11: Get that value Roll 12: Reroll and add one to the value The "roll 12" rule can be hit multiple times. For example, if you roll (6,6) then (6,6) then (1,1), your total value for that game will be 4 (as 1+1+2-4). Write a program that simulates one iteration of this game. After making this part, ask the user how many times you want them to simulate the game. Then simulate the game the requested amount of times and show what percentage each game value occured. Note: Make sure you use srand(time(0)) or srand(time(NULL)) (same thing) at the start of your main once and never again Example 1 (user input is underlined, but values are random for low input): How many simulations? 1 11 happened 100%

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago