participant-id,category,timestamp,prompt,answer,stimulus-id,previous-delay,stimulus_time 122,3,179518899.631833,Implement a function secondGreatest that accepts a vector of integers and returns the second greatest element in the vector,int secondGreatest(vector& v) { int min = v.front(); size_t for (int i = 0; i < v.size(); ++i) { } },7,13984.312238198958,60000 participant-id,category,timestamp,prompt,answer,stimulus-id,previous-delay,stimulus_time 122,3,179583381.67307,Implement a function is_sorted that accepts a vector of integer values and returns true if it is non-decreasing, and false otherwise,bool is_sorted(vector& v) { bool non_decreasing = true; for (int i = 1; i < v.size(); ++i) { if (v[i] < v[i - 1]) } },3,4470.746782764543,60000 participant-id,category,timestamp,prompt,answer,stimulus-id,previous-delay,stimulus_time 122,3,179649000.43472,Write the definition of a function isPositive, that receives an integer parameter and returns true if the parameter is positive, and false otherwise.,static inline bool isPositive(int i) { return i > 0; },2,5604.639122570372,60000 122,3,179715463.480606,Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 1999-2002. Given an int variable modelYear and a string modelName, print "RECALL" if modelYear and modelName match the recal details,bool isRecalled(int modelYear, const string& modelName) { if (modelName == "Extravagant" && modelYear >= 1999 && modelYear <= 2002) { cout << "RECALL" << endl; } },0,6429.877300177124,60000 participant-id,category,timestamp,prompt,answer,stimulus-id,previous-delay,stimulus_time 122,3,179780694.394331,Implement a function countdown() that accepts an integer n as a parameter and counts down from n, printing each number to standard output, separated by a space. After reaching n, print "liftoff!",void countdown(int n) { // after reaching 0? for ( ; n > 0; --n) { cout << n << " "; } cout << "liftoff!" << endl; },8,5208.119025398855,60000 122,3,179846636.625951,Given a string, s, and an integer, x, update s such that its characters are shifted by x. Ex. s = "cd", x = 1. Loop results in s = "de",for (size_t i = 0; i < s.size(); ++i ) { char c = s[i]; s[i] = c + x; },4,5910.418520830489,60000 participant-id,category,timestamp,prompt,answer,stimulus-id,previous-delay,stimulus_time 122,3,179912206.577172,Implement a function containsDuplicate that accepts a vector of integers and returns true if it contains a duplicate element, and false otherwise,bool containsDuplicate(vector v) { sort(v.begin(), v.end()); for (size_t i = 1; i < v.size(); ++i) { int before = v[i = 1]; int curr = v[i]; if (before ) } },6,5536.320675078126,60000 122,3,179977239.728803,Given integer variables amount and total both initialized to 0, write a loop that reads in values for amount from standard in and adds them to total until total is greater than 100.,while (cin >> amount && total <= 100) { total += amount } ,5,5009.034887347797,60000 participant-id,category,timestamp,prompt,answer,stimulus-id,previous-delay,stimulus_time 122,3,180040121.875571,Write a statement that toggles the value of the bool variable onOffSwitch. That is, if onOffSwitch is false, itsvalue is changed to true; if onOffSwitch is true, its value is changed to false.,onOffSwitch = !onOffSwitch;,1,2846.5314476337417,60000