Question: create all functions and the main() in one single .cpp file 1. This problem considers several ways to compute x for some n = 0.
create all functions and the main() in one single .cpp file

1. This problem considers several ways to compute x" for some n = 0. 1) Write an iterative function power1 to compute x" for n 20. 2) Write a recursive function power2 to compute x" by using the following recursive formulation: x = 1; x" = (x1/2)? if n>0 and n is even; x"=x* (x1/2)? if n>0 and n is odd. 0 n = n 2. Write a recursive binarySearch function for an array of strings (already sorted), that returns the indexes of all the strings whose first letter is A | "a". = For example, for anArray = {Arrow, art, box, curve, line), the search result should show: indexes = {0, 1}. Notes: You should set the target letter to be a variable, so thtwe can use your function to search strings starting with any given letter withing a-z / A- Z. 3. Write a main() function that tests all the above functions, with two test cases for each function. You may create a menu of choices for user to choose which function to test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
