Can anyone do the following problem?
Write a method that takes 2 integer parameters, and returns the result of the first parameter value raised to the power of the second parameter value. Do not use Java API.
For example, if the first parameter value is 2 and the second parameter value is 5, then the method will return 32, since 2^5 = 2 x 2 x 2 x 2 x 2 = 32.
Remember, the methods are needed to work in the general case. So the above is just a specific example. your method should be able to work for any parameter values given to it, not just for the values of 2 and 5. Hint: you will need to use a single loop, since you are repeatedly multiplying by a number.
For simplicity, you may assume that the second parameter value is always a positive number.
Check the result of your method by printing out the returned value in the main method, which uses the method you wrote.
Thank you!