Code:

// program that uses switch statement to allow the user the choose what memeber //function to be tested

#include<iostream>

using namespace std;

#include<vector>

using std::vector;

#include <iomanip>

using std::setw;

void pop_back();//removes the last element from vector

void push_back(const T& x);//stores a value in the last element of the vector

void resize ( size_type sz, T c = T() );//change the size of vector

void clear();//clears vectore from all elements

void reverse();//reverse the oreder of the element in vector

void outputVector( const vector< int > & );

void inputVector( vector< int > & );

vector < int> integers (5); //vector declaration

int main()

{

int function;// switch statement variable

cout <<"Size of vector integers is "<< integers.size()

<<"\nvector after initialization" << endl;

outputVector( integers );

cout << "\nEnter 5 integers:"<< endl;

inputVector( integers );

cout <<"\nAfter input, the vectors contain:\n"

<<"integers" << endl;

outputVector( integers );

cout<<" Enter a number to choose function\n";

<<"1 to pop_back\n";

<<"2 to push_back\n";

<<"3 to resize\n;

<<"4 to clear vector\n"

<<"5 to reverse vectore"<<endl;

cin>>function;

while (function != EOF)

{

switch (function)

{

case 1:

cout<<" the new vector is"<<integers.pop_back()<<endl;

break;

case 2:

cout<<" the new vectore is"<<integers.push_back()<<endl;

break;

case 3:

cout<<" the new vector is"<<integers.resize(7,11)<<endl;

break;

case 4:

cout<<the new vector is"<<integers.clear()<<endl;

break;

case 5:

cout<<"the new vector is "<<integers.reverse()<<endl;

break;

default:

cout<<"incorrect function number"

<<"enter a new function number"<<endl;

break;

}//end switch

}//end while

return 0;

}// end main

void pop_back()

{

for( size_t i = 0; i < integers.size(); i++)

{

cout<<setw(12)<<integers[i];

}

}

void push_back(const T& x)

{

for (size_t i =0; i < integers.size(); i++)

{

cout<<setw(12)<<integers.push_back(7);

}

}

void clear()

{

for ( size_t i= 0; i < integers.size(); i++)

{

cout<<setw(12)<<integers.clear();

}

}

void resize( size_type sz, T c = T() )

{

for ( size_t i =0; i < integers.size(); i++)

{

cout<<setw(12)<<integers.resize(7,11);

}

}

void reverse()

{

for(size_t i = 0; i<integers.size(); i++)

{

cout<<setw(12)<<integers.reverse();

}

}

void outputVector( const vector< int > &array )

{

size_t i; // declare control variable

for ( i = 0; i < array.size() ; i++ )

{

cout << setw( 12 ) << array[ i ] ;

if (( i + 1 ) % 4 == 0 ) // 4 numbers per row of output

cout << endl;

} // end for

if ( i % 4 != 0 )

cout << endl;

} // end function outputVector

// input vector contents

void inputVector( vector< int > &array )

{

for ( size_t i = 0; i < array.size(); i++ )

cin >> array[ i ] ;

} // end function inputVector