Question: Write a program in C++ that simulate a dice roll. The program should use the rand() function and include . With this parameters : diceSides

Write a program in C++ that simulate a dice roll. The program should use the rand() function and include .

With this parameters :

diceSides * quantityDices < 100

example:

i want 4 dices with 8 sides each, so i got 32 sides . /* The program needs to ask me how many dice and sides i want */

How many dice rolls would you like to perform? /* The program needs to ask me */

2

Then i need to sum the value of each dice :

dice1 : 4 - dice2 : 6 - dice3 : 8 - dice4 : 2 = 20

dice1 : 7 - dice2 : 4 - dice3 : 7 - dice4 : 5 = 23

Then print on the console the times percentage of each value like this :

4 = 0% .... 20 = 50% , 21 = 0%, 22 = 0% , 23 = 50% ... , 32 = 0% .

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 Databases Questions!