Question: In c++ Create a simple command line program that simulates the rolling of a pair of six-sided dice a user given number of times. The
Create a simple command line program that simulates the rolling of a pair of six-sided dice a user given number of times. The number of times to roll the pair of dice should be read as input from the argv array on the command line. The result of each roll should be stored in a struct with at least two int fields: dice01 and dice02. As the structs are created they need to be stored in an ordered linked list (ordered by the total). After the last roll, process the list of rolls and count how many times each result occurred. The output should cover the two impossible (for 6 sided dice) results of 1 and 13. After the calculated results are displayed, print out the entire list of rolls showing the roll count, the value of each dice, and finally the total An example of running the program from the command line might be: rolldice2.exe 10e The resulting output should be similar to: Dice Result: Number of occurrences 1: (should always be zero) 3: 23 (omitting results for 4 thru 11 to save space your program should print them!) 12: 8 13: (should always be zero) Actual Dice Rolls: Roll 1: Dice A: 1, Dice B:, Total: 2 Roll 2: Dice A: 1, Dice B: 1, Total: 2 Roll 3: Dice A: 1, Dice B: 2, Total: 3 (omitting results for 4 thru 98 to save space your program should print them!) Rol1 99: Dice A: 5, Dice B: 6, Total: 11 Roll 100: Dice A: 6, Dice B 6, Total: 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
