Menu

[Solved]Display List Values Code Given Make Struct Code Work Linked List Data Field Integer Sum Fi Q37299893

1.

Display the list values (code is given), but you have to make a struct for the code to work The linked list should have a dat

2.

3.

Display the sum of all numbers in the list For this you have to write the getSumOfAllNumbers(.). function Running your progra

4.

Set the sum value for each node to be the accumulated sum of numbers on the list so far. You have to write a function setAccu

accumulated sum of numbers on the list so far 4. Exit program Your choice -3 Setting accumulated sums. Menu options: 0. Displ

in C++ please

Display the list values (code is given), but you have to make a struct for the code to work The linked list should have a data field which is an integer, a sum field which is an integer and a pnext pointer to the next node. Running the code should look like Enter list numbers separated by space, followed by -1:357-1 Menu options 0. Display the list number values (provided for you). 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. . Set the sum value for each node to be the accumulated sum of numbers on the list so far . Exit program Your choice-0 The list number values are: 7 5 3 We were unable to transcribe this imageDisplay the sum of all numbers in the list For this you have to write the getSumOfAllNumbers(.). function Running your program should look like this: Enter list numbers separated by space, followed by -1:357-1 Menu options 0. Display the list number values (provided for you) 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the accumulated sum of numbers on the list so far 4. Exit program Your choice ->2 The sum of all numbers on the list is: 15 Set the sum value for each node to be the accumulated sum of numbers on the list so far. You have to write a function setAccumulatedSums.(.) which traverses the linked list (goes through each node) and calculates the sum of that nodes data value and the data value of nodes before that node. and store that value in the sum field of the linked list So your linked list should look something like this: 15151 1 6 I 111 1 here the sum field of the first node the sum part of the node has 5 and for the second node it s 5-6 – 11 and so on. Running your program should look like this: Enter list numbers separated by space, followed by-1:357-1 Menu options 0. Display the list number values (provided for you). 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the accumulated sum of numbers on the list so far 4. Exit program Your choice -3 Setting accumulated sums. Menu options: 0. Display the list number values (provided for you) 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the accumulated sum of numbers on the list so far 4. Exit program Your choice -> 1 The list number and sum values are: 7:7 5:12 3:15 Menu options: 0. Display the list number values (provided for you) 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the accumulated sum of numbers on the list so far 4. Exit program Your choice – 4 Exiting program. Show transcribed image text Display the list values (code is given), but you have to make a struct for the code to work The linked list should have a data field which is an integer, a sum field which is an integer and a pnext pointer to the next node. Running the code should look like Enter list numbers separated by space, followed by -1:357-1 Menu options 0. Display the list number values (provided for you). 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. . Set the sum value for each node to be the accumulated sum of numbers on the list so far . Exit program Your choice-0 The list number values are: 7 5 3

Display the sum of all numbers in the list For this you have to write the getSumOfAllNumbers(.). function Running your program should look like this: Enter list numbers separated by space, followed by -1:357-1 Menu options 0. Display the list number values (provided for you) 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the accumulated sum of numbers on the list so far 4. Exit program Your choice ->2 The sum of all numbers on the list is: 15
Set the sum value for each node to be the accumulated sum of numbers on the list so far. You have to write a function setAccumulatedSums.(.) which traverses the linked list (goes through each node) and calculates the sum of that nodes data value and the data value of nodes before that node. and store that value in the sum field of the linked list So your linked list should look something like this: 15151 1 6 I 111 1 here the sum field of the first node the sum part of the node has 5 and for the second node it s 5-6 – 11 and so on. Running your program should look like this: Enter list numbers separated by space, followed by-1:357-1 Menu options 0. Display the list number values (provided for you). 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the
accumulated sum of numbers on the list so far 4. Exit program Your choice -3 Setting accumulated sums. Menu options: 0. Display the list number values (provided for you) 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the accumulated sum of numbers on the list so far 4. Exit program Your choice -> 1 The list number and sum values are: 7:7 5:12 3:15 Menu options: 0. Display the list number values (provided for you) 1. Display the list number and sum values. 2. Display the sum of all numbers on the list. 3. Set the sum value for each node to be the accumulated sum of numbers on the list so far 4. Exit program Your choice – 4 Exiting program.

Expert Answer


Answer to Display the list values (code is given), but you have to make a struct for the code to work The linked list should have … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *