Write a method IntegerPower( base, exponent ) that returns the value of base^exponent ..
For example, IntegerPower( 3, 4 ) = 3 * 3 * 3 * 3. Assume that exponent is a positive, nonzero integer, and base is an integer. Method IntegerPower should use for or while to control the calculation. Do not use any Math library methods. Incorporate this method into a Win- dows application that reads integer values from TextBoxes for base and exponent from the user and performs the calculation with the IntegerPower method.
Write a method IntegerPower( base, exponent )
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Dec 10, 2012, 1:29 PM EST
Note that 'base' is a keyword in C# so I've used 'b' and 'e' as the parameter names rather than 'base' and 'exponent'.