Intro the Computer Sc

Description

You have to do lab 10

Don't use plagiarized sources. Get Your Custom Assignment on
Intro the Computer Sc
From as Little as $13/Page

Unformatted Attachment Preview

CSE 112 – Introduction to Computer Science II
CSE 112 – Lab #10 Linked List using the STL list container – Linked Lists
Requirements: Using the STL list container, create the list on page 1157 (18 – 6), and modify the program
as described below.







Define a list object, and populate it using a loop as shown in 18-6, but up to 200 by 20’s.
Call a function to display the list and output the number of nodes in the list.
Then, call a function to add to the list the numbers (10, 30, 50, 70, 90, 110, 130, 150, 170)
inserting them in numerical order using a loop, an iterator, list.begin, and list.insert.
Then call the display function to display the list again and the number of nodes.
Then reverse the list and display it again, and output the number of nodes.
Then call a function that removes the ends of the list, and then redisplay the list and the
number of nodes.
Use an iterator in the solution for adding the numbers and for output at a minimum.
All output is to be done in the output function. The output function that displays the list must accept a
string for the message prior to displaying the list and the number of nodes.
Sample output function declaration:
void display_list(list &myList, string message);
Sample output function call:
display_list(myList, “The original list is: “);
Output Format and contents:
Grading will be based on meeting all of the lab requirements, adherence to programming standards,
operation and accurate output, and programming style including white space and indentation.
1
Assignments submitted after the due date will incur a grade penalty of three (3) points per day
after the first day, and will not be accepted more than one (1) week late.

Purchase answer to see full
attachment