完了

Dice

**Due Friday, June** **25**

Design and implement a Visual C++ .NET program that simulates rolling a pair of standard six-sided dice as described below.

Consider this experiment: Roll two dice and remember their sum (this is called the target sum). Repeatedly toss the two dice again until the same target sum reappears. Count the total number of times the two dice are tossed, including the initial and final tosses that both yield the target sum. The minimum possible number of tosses is two in any trial of this experiment.

Your program should first prompt the user to enter the number of times to try the above experiment, and then repeat this experiment the specified number of times.

For each possible target sum (2 through 12), print the number of trials that used this particular target sum, and also print the average number of tosses that were made during the trials which used this target sum. Arrange these results in tabular form as shown in the sample runs below.

_**Clarification and example**_**_:_**

Each trial of the experiment consists of rolling two dice to obtain a target sum, and then continuing to roll the dice until the same target sum reappears. So a single trial consists of at least two dice rolls, and likely more than two dice rolls. The number of trials is specified by the user. Suppose the user specifies 2 trials, and this sequence of tosses occurs:

Trial 1: 7 10 5 7 (4 tosses)

Trial 2: 7 4 9 8 6 4 11 10 7 (9 tosses)

So for the target sum 7, the number of trials is 2, and the average number of tosses is (4+9)/2 = 6.5

The only libraries that may be included for this project are <iostream>, <cstdlib>, and <ctime>. Seed the random number generator so that different results are obtained on each run.

Do NOT use any arrays.

Here are three sample runs:

<[login to view URL]>

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

## Platform

Windows C++.net

スキル: C プログラミング, エンジニアリング, マイクロソフト, MySQL, PHP, ソフトウェアアーキテクチャ, ソフトウェアテスト, 研修, ウェブホスティング, ウェブサイト管理, ウェブサイトのテスト, ウィンドウズデスクトップ

さらに表示: work ua, the sum of 11 times s and 3, pair programming, design seed, cstdlib, cs programming, c programming random number, c programming arrays, code generator .net, arrays in programming, arrays in c programming, dice roll, dice roll sequence, sample generator, single use code generator, dice rolling code, seed random number generator, generator seed, random code generator, rolling code

採用者について:
( 7件のレビュー ) United States

プロジェクトID: #3257157

アワード:

mcduckvw

See private message.

$5 USD 1日以内
(36レビュー)
4.9

25人のフリーランサーが、このジョブに平均$12で入札しています

xmartian

See private message.

$25.5 USD 1日以内
(28件のレビュー)
6.5
blackstargb

See private message.

$8.5 USD 1日以内
(64件のレビュー)
6.0
JamesShields

See private message.

$17 USD 1日以内
(105件のレビュー)
5.3
unamigo

See private message.

$21.25 USD 1日以内
(51件のレビュー)
5.3
infoteamro

See private message.

$21.25 USD 1日以内
(14件のレビュー)
4.1
srsoftvw

See private message.

$8.5 USD 1日以内
(12件のレビュー)
3.5
gworroll

See private message.

$12.75 USD 1日以内
(42件のレビュー)
3.7
abirovw

See private message.

$7.65 USD 1日以内
(29件のレビュー)
3.5
MyRiddler

See private message.

$10.2 USD 1日以内
(31件のレビュー)
3.7
kchernysh

See private message.

$6.8 USD 1日以内
(7件のレビュー)
3.0
TheHero

See private message.

$17 USD 1日以内
(13件のレビュー)
2.7
eleusive

See private message.

$8.5 USD 1日以内
(8件のレビュー)
2.4
SimplrSolutions

See private message.

$8.5 USD 1日以内
(7件のレビュー)
2.4
sste

See private message.

$3.4 USD 1日以内
(4件のレビュー)
1.7
smitsvw

See private message.

$18.7 USD 1日以内
(4件のレビュー)
1.1
laur3ntiu

See private message.

$8.5 USD 1日以内
(レビュー1件)
0.3
vw1184884vw

See private message.

$6.8 USD 1日以内
(レビュー1件)
0.5
cs314

See private message.

$8.5 USD 1日以内
(0件のレビュー)
0.0
ethin

See private message.

$17 USD 1日以内
(0件のレビュー)
0.0
stefanspx

See private message.

$25.5 USD 1日以内
(2件のレビュー)
0.8