Question: 5.15 LAB: Using the built-in C++ sort() and reverse() functions on a vector Write a C++ program that reads in an unknown number of

5.15 LAB: Using the built-in C++ sort() and reverse() functions on a vector Write a C++ program that • reads in an unknown number of integers into a vector, • displays the contents of the vector, uses the built-in C++ sort() function to sort the vector in ascending order; displays the vector contents in ascending order; uses the built-in C++ reverse() function to reverse the contents of the vector, and • displays the vector contents in descending order. . Additional instructions are provided as instructions in the file main.cpp below.... r#include #include // for sort, #include reverse using namespace std; int main() 1/ STEP 1: Read in an unknown number of integers into an integer vector. // STEP 2: Display the contents of the vector. // STEP 3: Use the built-in C++ sort() function to sort in *ascending* order. // STEP 4: Display the vector contents in *ascending* order. // STEP 5: Use the built-in C++ reverse() function to reverse the contents of the vector. // STEP 6: Display the vector contents in *descending* order. return 0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!