Actions Problems
Math Actions: Power
For this problem, add a Power action with two integer parameters and an integer return value. Once you have completed the action, call the action with the arguments 3, 2(e.g., result = Power(3, 2)). Then, output the result. When run, the program should output the following.
-6
-2
15
17.0
true
78
9
Coding:
Hint
Great job!
Try again
Using the other actions as a guide, build the Power action, action Power(integer base, integer exponent) returns integer. Use a loop block to multiply the base by itself the number of times in the exponent. Keep in mind, if the exponent is 1, the base value is returned.
