Question: IN C++ Copyright 2017, Dennis Rainey Data Structures Page 1 of 3 HW 5abc HW 5 s- Add a list of numbers using -list 1.)

IN C++ IN C++ Copyright 2017, Dennis Rainey Data Structures Page 1 of 3

HW 5abc HW 5 s- Add a list of numbers using -list

1.) Declare a list object named: aList 2.) Declare an iterator to

Copyright 2017, Dennis Rainey Data Structures Page 1 of 3 HW 5abc HW 5 s- Add a list of numbers using -list 1.) Declare a list object named: aList 2.) Declare an iterator to be used with list objects and named: 3.) Call a function named: getNumbers it - The function is void-returning - Pass the list object to the function as a parameter. - Use a for loop to insert 5 integer values into the list. With each iteration, prompt the user to enter an integer value. With each iteration, one input value is read into the list object o o 4.) Call a function named: addNumbers Pass the list object to the function as a parameter. - Use a for loop and the iterator, it, to add the values in the list. - The function returns the sum of all list values 5.) Call a function named: displaySum The function displays the list of numbers and the sum. (see output) OUTPUT Enter 5 integer values. Enter a value: 5 Enter a value: 7 Enter a value: 3 Enter a value: 4 Enter a value: 2 Here is the list: 5 734 The sum equals: 21

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!