Question: 2.20 Assignment Part 3: Dice Roll In Dungeons & Dragons, and similar role-playing games, dice with different numbers of sides are used to determine the

 2.20 Assignment Part 3: Dice Roll In "Dungeons & Dragons, and
similar role-playing games, dice with different numbers of sides are used to
determine the outcomes of events throughout the game. There are different dice
for different occasions. 4-sided, 6-, 8- 10-12 and 20-sided dice are common

2.20 Assignment Part 3: Dice Roll In "Dungeons & Dragons, and similar role-playing games, dice with different numbers of sides are used to determine the outcomes of events throughout the game. There are different dice for different occasions. 4-sided, 6-, 8- 10-12 and 20-sided dice are common A required roll is typically designated d where is the number of dice to throw and is the number of sides on those dice. For example, 2d6 means throw two 6-sided dice and add the results, and 1d12 means throw one 12-sided die, This lab requires you to write a program to read in the number of sides on the dice to throw, and then simulate throwing two of them and summing the result, three times in total For example, a program run might look like this Number of sides (4, 6, 8, 10, 12, 2016 2d6 result: 3 + 2 = 5 206 result: 5 + 49 206 result: 2 + 2 = Hints 1) Read the input into an integer variable 2) DO NOT change the seed in the srand() call from the starter code is required for the test runs to generate predictable results, 3) An N sided die should return results in the range IN 4) You might want to review the documentation on rapide 1:2d4 Output differs. See highlights below. Input 4 + Your output ends with 2d4 result: 2d4 result: 3+ 2d4 result: 3 + + Expected output ends with 2d4 result: 2d4 result: 2d4 result: + + 2: 2d6 ^ Output differs See highlights below Input 6 Your output ends with 206 result: 5 + 206 result: 15 2d6 results 1 + + 11 2d6 result: 206 result: 1 206 results 1 - 2 Expected output ends with 11 un = 3: 2d8 A Output differs. See highlights below. Input 8 Your output ends with 2d8 result: 288 result: 208 result: + + Expected output ends with 2dB result: 28 result: 5 + 2de result: + + + NIN 4. 2012 Output differs. See highlights below. Input 12 Your output ends 2012 result: 6 + 6 = 12 2012 result: 7+ 3 = 10 2012 result: + 9 = 16 with Expected output ends with 2012 result: 2 + 3 = 5 2012 results + 101 2012 reguit = 3 5: 2020 Output differs See highlights below Input 20 Your outout ends with 2620 results 18 = 32 2820 resu: 1- 11 - 15 2020 result: 19 13 = 32 Expected outout ens 2020 zesu 18 19 29 2020 eB2033 202 zasu #include #include #include using namespace std; int main() t // replace this srand with the one provided srand( (unsigned)time(NULL)); cout > sides; for(int i = 0; i

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!