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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1DE
icon
Related questions
Question
100%

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

 

Vmain() : int
W
C:AUsers\User\Desktop\11\bin\Debug\11.exe
ent
[2]-[4]-[5]-11
[1]-[1]-13
jects Sym
rkspace
Process returned 0 (0x®)
O Sources Press any key to continue.
11
execution
Transcribed Image Text:Vmain() : int W C:AUsers\User\Desktop\11\bin\Debug\11.exe ent [2]-[4]-[5]-11 [1]-[1]-13 jects Sym rkspace Process returned 0 (0x®) O Sources Press any key to continue. 11 execution
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L