Hi, c++ help Please see my code The code reads two numbers from a file and creates a dice which must be played a certain amount of times (dertimined by input file). The code must then output the results of the multiple dice rolls.
Hi, c++ help
Please see my code
The code reads two numbers from a file and creates a dice which must be played a certain amount of times (dertimined by input file).
The code must then output the results of the multiple dice rolls.
For line 1
**the numbers in brackets are the results of the multiple dice roll while the last number is the sum of the throws for the first die
As you can see for the first line everything adds up correctly as the results of the dice (in brackets) are summed up correctly (last number)
For the second row and all other following rolls, the code adds the rolls of the new dice and the result of the previous sum to get the new sum.
This should not happen, I want the sum of each rows to be displayed on the end of each line
The correct code should be display **please don't output comment
[2] - [4 ]-[5] - 11 //dice rolled 3 times and sum is 11
[1] - [1 ]-2 //dice rolled 2 times with sum 2
Step by step
Solved in 2 steps