Question
5.16 LAB: Using the built-in C++ sort() and reverse() functions on a vector of tuples How does the built-in C++ sort() function deal with tuples?
5.16 LAB: Using the built-in C++ sort() and reverse() functions on a vector of tuples How does the built-in C++ sort() function deal with tuples? Which field/attribute does it sort on? To answer this question, you will write a C++ program that • reads in an unknown number of grocery items (each with a name, a unit price, and a quantity) 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started