Question: 4 . Create a useful method ( 1 5 s ) 4 . 4 . 1 . Write a method called PrintPowersofn that acce a
Create a useful method s Write a method called PrintPowersofn that acce a base and a maximum exponent as arguments. The method prints each XO power of the base from o up to that maximum exponent, inclusive. PrintPowerOfN does not need to return anything. It only displays results on screen. For example: Print PowersOEN ; This calculates and should output Print PowersofN ; should output This calculates and Print PowersOfN; should output Both arguments are integers. You may assume that the maximum exponent passed to PrintPowersOfN has a value of or greater. The Math class may help you with this problem! If you use it you may need to cast its results from double to int so that you don't see a after each number in your output. You may also write this program without using the Math class. Either solution is acceptable so long as it displays the correct output. Please use the three sample calls in your submitted program run. Your program must work for other valid integers besides those listed in the sample calls. You are welcome to include additional calls, with other values, after these three.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
