Question: C++, you can write it in Java too! Description: There are two possible solutions for calculating the power function recursively (see the algorithms below). For

Description: There are two possible solutions for calculating the power function recursively (see the algorithms below). For this project, you will write a program that has those two versions of the power function. You will also include global variables that will be used to keep track of the number of times each function is called and how many times each of the then and else clauses are done. (You will need a total of six global variables.) You are to write the main program that will initialize the global counters, ask the user for numbers (X and Y) to use for the calculations, you will do the calculation using both versions, and then you will output the answer along how much work each of the versions did. In your project report, you should discuss these results and what they mean about the efficiency of these two versions. When running your program, you should probably use 2 for X and numbers no greater than about 30 for Y so that we don't have to worry about overflowing the values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
