/* Name: * Date: * Description: */ #include using std::cout; using std::endl; int main(){ cout << "---------------------- STL vector ----------------------\n"; // declare container here cout << "Enter numbers to store in STL containers (enter a letter to stop)\n"; // read in integers from STDIN here and store them in the vector cout << "There are " << << " integers in the vector" << endl; // print out the contents of the container in the reverse order that they were read in cout << "---------------------- STL list ----------------------\n"; // declare container here // copy elements from the vector into this container (in the order that they were entered) cout << "There are " << << " integers in the list" << endl; // print out the contents of the container in the reverse order that they were read in // Hint: Make a copy of the elements into a second list first . . . cout << "---------------------- STL deque ----------------------\n"; // declare container here // copy elements from the vector into this container (in the order that they were entered) cout << "There are " << << " integers in the deque" << endl; // print out the contents of the container in the reverse order that they were read in cout << "---------------------- STL stack ----------------------\n"; // declare container here // Optionally, for a challenge, specify the underlying container (and it's type) when declaring the stack container (and it's type) // copy elements from the vector into this container (in the order that they were entered) cout << "There are " << << " integers in the stack" << endl; // print out the contents of the container in the reverse order that they were read in cout << "---------------------- STL queue ----------------------\n"; // declare container here // copy elements from the vector into this container (in the order that they were entered) cout << "There are " << << " integers in the queue" << endl; // print out the contents of the container in the reverse order that they were read in // Hint: For each element, make a temporary queue with all of the remaining elements in it . . . cout << "---------------------- STL priority_queue ----------------------\n"; // declare container here // copy elements from the vector into this container (in the order that they were entered) cout << "There are " << << " integers in the priority_queue" << endl; cout << "Priority queues do not keep track of the insertion order of their contents, but here's it's contents:\n"; // print out the contents of the container cout << "\nCan the number of elements and the contents be printed out in the order that they were entered for associative containers? Why?\n"; /* * Answer the question here with a cout statement */ /* * lab17B */ cout << "\n\n---------------------- Printing out the contents in the ordered entered using iterators ----------------------\n\n"; cout << "---------------------- STL vector ----------------------\n"; // use STL vector iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "---------------------- STL array ----------------------\n"; // use STL array iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "---------------------- STL list ----------------------\n"; // use STL list iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "---------------------- STL forward_list ----------------------\n"; // use STL forward_list iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "---------------------- STL deque ----------------------\n"; // use STL deque iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "---------------------- STL stack ----------------------\n"; // use STL stack iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "---------------------- STL queue ----------------------\n"; // use STL queue iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "---------------------- STL priority_queue ----------------------\n"; // use STL priority_queue iterators to print out the values stored in the container if possible (otherwise print out why it's not possible) cout << "\n---------------------- Determine the unique elements in the vector (using STL algorithms) and print them out ----------------------\n\n"; // determine the unique elements in the vector (using STL algorithms) // Hint: You'll need to use a couple of different functions cout << "There are a total of " << << " unique integers:\n"; // print out the unique elements return 0; }