I need to enter two numbers using the slider bars
Number 1=x
Number 2=x
Answer=x
Then i need it to take number one and make number two the 'to the power of'
For instance
e.g 1
Number 1=5
Number 2=4
So that will become 5^4 and the calculation is 5*5*5*5
e.g 2
Number 1=9
Number 2=5
So that will become 9^5 and the calculation is 9*9*9*9*9
Then display the answer
I Can do the sliders and all that for basics maths, i'm having trouble to get it to work this out as i don't know how to tell it to use Number 1 (slider 2) and multiply itself by the value of slider 2
Hope thats makes sense
Any help would be greatly appreciated
Offline
3 variables required:
Number
Power
Result
Then, after Number and Power are entered:
Set (Result) = 1
Repeat (Power)
Set Result=(Result)*(Number)
So, if you entered 5 and 4, as in your example
1st repeat: Result = 1x5 = 5
2nd Repeat: Result = 5x5 = 25
3rd Repeat: Result =25x5 = 525
4th Repeat: Result = 525 x 5 = 2625
Doesn't work if the power is set to less than one, though. If you need these, you'd need some additional tweaking.
Offline
Here: http://scratch.mit.edu/projects/Mayhem/287259
Offline