Question: This missing code in C++ find the main ccp #include #include #include #include // to use sort() using namespace std; const int NUM_VALUES = 5;

This missing code in C++

This missing code in C++ find the main ccp #include #include #include

find the main ccp

#include #include #include #include // to use sort() using namespace std;

const int NUM_VALUES = 5;

// Input NUM_VALUES of TheType into the vector parameter template void Read(vector& list) { for (int j = 0; j > list.at(j); } }

// Output the elements of the vector parameter template void Write(vector& list) { long unsigned int j; for (j = 0; j

// Return the min, median, and max of the vector parameter in a new vector template vector GetStatistics(vector& list) { /* Type your code here. */ }

// Read values into a vector, sort the vector, output the sorted vector, // then output the min, median, and max of the sorted vector template void Run(vector& list) { /* Type your code here. */ }

int main() { vector integers(NUM_VALUES); Run(integers); cout

vector doubles(NUM_VALUES); Run(doubles); cout

vector strings(NUM_VALUES); Run(strings);

return 0; }

Given the definitions of main(), Read() and Write(), complete main.cpp by implementing the following member functions: template vector GetStatistics (vector \& 1 ist) - Take a vector template as a parameter - Store the minimum, median, and maximum values of the vector parameter into a new vector - Return the new vector template> void Run(vector \& list) - Take a vector template as a parameter - Call Read() with the vector parameter as an argument. Read() stores 5 input values into the vector parameter - Sort the vector parameter - Call Write() to output the sorted vector - Output a new line - Call GetStatistics() with the sorted vector as an argument. GetStatistics() returns a vector containing the minimum, median, and the maximum values of the sorted vector - Call Write() to output the vector returned by GetStatistics() - Output a new line Note: vector.size() returns a long unsigned int, not an int. Hint: Use the built-in sort function to sort a vector. Ex: If the input is: 12.2onetwothreefourfive33.351.14.45.597 the output is: Given the definitions of main(), Read() and Write(), complete main.cpp by implementing the following member functions: template vector GetStatistics (vector \& 1 ist) - Take a vector template as a parameter - Store the minimum, median, and maximum values of the vector parameter into a new vector - Return the new vector template> void Run(vector \& list) - Take a vector template as a parameter - Call Read() with the vector parameter as an argument. Read() stores 5 input values into the vector parameter - Sort the vector parameter - Call Write() to output the sorted vector - Output a new line - Call GetStatistics() with the sorted vector as an argument. GetStatistics() returns a vector containing the minimum, median, and the maximum values of the sorted vector - Call Write() to output the vector returned by GetStatistics() - Output a new line Note: vector.size() returns a long unsigned int, not an int. Hint: Use the built-in sort function to sort a vector. Ex: If the input is: 12.2onetwothreefourfive33.351.14.45.597 the output is

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 Databases Questions!