Power operation using MARIE

Thread Starter

Kingsley.wky

Joined Apr 5, 2017
1
I have an assignment about the Power operation and heres how it goes,

The power operation is defined as repeated multiplication of the same factor. For example, 9 power 2 is 9 × 9 = 81, and 3 power 5 is 3 × 3 × 3 × 3 × 3 = 243.
More generally, we have X power Y, where X is called the base, and Y is called the exponent. Exponent corresponds to the number of times the base is used as a factor. My goal is to repeatedly use the Multiply subroutine to implement a subroutine for power? Any idea how?
 

djsfantasi

Joined Apr 11, 2010
9,162
Is the base always an integer? How large can it be? You need to know this to define your variables.

Is the exponent always an integer? I expect that it is in this problem.

You have described exactly what your power routine should do. Now, translate that into code. How do you think you should do it! This looks like homework, so you have to show us how far you can get and we'll help you over the hump.
 
Top