Lab 17B: STL Iterators and Algorithms

  < Previous

Assignment:

Extend your lab17A.cpp code in a new file named lab17B.cpp, by adding the following code:
    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

Submission

Submit your source code using the handin program. For handin, for this lab, type the following in a terminal window exactly as it appears:
handin  lab17B  lab17B.cpp
To verify your submission, type the following in a terminal window:
handin  lab17B