Question: Java, Create a static function, called exp, that has two integer parameters, a base and an exponent. The function will then calculate and return the

Java,

Create a static function, called exp, that has two integer parameters, a base and an exponent. The function will then calculate and return the value of the base number to the exponent. Then, create a small program to call the function and determine the value of 2 to the exponent 8. (You can assume the exponent is a positive, non-zero integer.)

e.g. int answer = exp(2, 8);

Note: There is an existing Java function that can do a similar task, but your function should not use another function to calculate the value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!