Question: Hi, I need help to finish my C++ code, and I'm having issues Input 2412 Your output 2dL2:22uit Expected output 7:1d12A 041 Output differs. See

Hi, I need help to finish my C++ code, and I'm having issues

Hi, I need help to finish my C++ code, and I'm havingissues Input 2412 Your output 2dL2:22uit Expected output 7:1d12A 041 Output differs.

Input 2412 Your output 2dL2:22uit Expected output 7:1d12A 041 Output differs. See highlights below. Input 1412 Your output Expected output 141 Input 3420 Ente= -d20 Your output 9:2d10 041 Output differs. See highlights below. Input 2410 our output2410 Expected output 2410 ait 3.1 T ASsighmeht Part 2. Dice Roll Redux n "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 designatednds> where is the number of dice to throw and s 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 such a designation, and then simulate throwing the appropriate dice, summing and displaying the result, three times in total NOTE: use the random number seed 1701, so that the test results will match when the program is implemented correctly We will simplify this a little by only dealing with 6, 10, 12 and 20 sided dice, and only allowing the user to specify 1-3 dice to be thrown For example, a program run might look like this: Choose 1, 2, or 3 dice (6-, 10-, 12-, or 20-sided) Enter designation (e.g. '2d6): 3d10 3d10 result: 8+99-26 3d10 result: 9+9 927 3d10 result: 5 + 1 + 9 = 15 The input should be validated, so if the number of dice is not 1, 2, or 3, or if the middle character is not 'd', or if the number of sides is not 6,10,12, or 20, the program should report the error Choose 1, 2, or 3 dice (6-, 10-, 12-, or 20 -sided) Enter designation (e.g. '2d6): 4x9 Not a valid designation Hints: 1) Read the number of dice into an integer variable 2) Read in (consume) the d character. 3) Read the number of sides into an integer variable 4) An N sided die should return results in the range 1.N 5) You might want to review the documentation on rando

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!