CSCI 2380 Functions 2: Death by Functions. Do the following problems. Submit your answers as a single file please. #1: Write a function that takes as input a vector of integers and returns the value of the largest integer in the vector: vector V; V.push_back(5); V.push_back(22); V.push_back(18); V.push_back(7); cout << "The largest is: " << maximum(V) << endl; //22 #2: Write a function that takes as input a vector of integers, along with a single integer, and increments every value in the vector by the given integer. vector V; V.push_back(5); V.push_back(22); V.push_back(18); V.push_back(7); increment(V, 20); cout << V[0] << endl; //25 cout << V[1] << endl; //42 cout << V[2] << endl; //38 cout << V[3] << endl; //27 #3: Write a function called ‘bool isPrime(int n)’ that returns true if n is prime, and false if n is not prime. Analyze the big-Oh run time of your solution: cout << isPrime(15) << endl; //false cout << isPrime(31) << endl; //true #4: Write a function ‘string factors(int n)’ which returns a string listing the prime factors of n: cout << factors(100) << endl; //2, 2, 5, 5 cout << facotrs(294) << endl; //2, 3, 7, 7 #5: Write a function called "random" that computes a random number between two given input numbers. Test your function with the following code to make sure a random number between 5 and 24 is output: int a = 5; int b = 24; cout << "A random number between " << a << " and " << b << " is " << random(a,b) << endl; #6: Write a function called "capital" that returns a capitalized version of an input string. Test your function with the following code to verify that "ROBBIE" is displayed: string name = "robbie"; cout << capital(name) << endl; #7: Write a function that takes an input string and changes the string to all capital letters. Test your function with the following code to verify that "BRENDA" is displayed: string name2 = "brenda"; capitalize(name2); cout << name2 << endl; #8: Write the mysterious function "enigma" into a program and test it with some values. Try to figure out what enigma does, and why it does it. Turn in a paragraph discussing your theory on what enigma does, along with an explanation of why it does what you say. Also, answer the following question: Is enigma a "cool" function or a "stupid" function. int enigma( int a, int b ) { if( b == 0 ) { return 1; } else { int x = enigma( a, b/2 ); if( b % 2 == 0 ) { return x*x; } else { return x*x*a; } } }