Lab 5 - STL Algorithms

Due: 5:00pm on Wednesday

The purpose of this lab is to learn how to use the STL algorithms. For this lab, you will use the STL algorithms on the STL vector class.

To use the STL algorithms and the vector class, you will need the following headers in your lab5.cpp file:

#include <vector>
#include <algorithm>
using namespace std;
This will give you access to the algorithms and the vector class. The vector class contains iterators and the standard iterator functions begin() and end(). For example, the following code snippet from page 565 of the book will sort a vector using the STL sort algorithm:
int ints[] = {555, 33, 444, 22, 222, 777, 1, 66};
vector<int> v(ints, ints + 5);      // Use only the first 5 elements of ints
sort(v.begin(), v.end());
Create a main program that does the following sequentially (no menus needed): Email me your completed program.