|
- Define one class 'Exponents',
your code will be all be contained in the
main()
method of this class. The file name of course must be called "Exponents.java".
(1 mark for an empty class and method definition, additional
marks will be awarded when you implement the features listed below).
(Y
|
|
-
The program will prompt the user for a base and a power (1 mark each
x 2 = 2 marks total) either of which can be any non-negative
integer
|
|
- The
program can correctly calculate an exponent when the power is zero
(the result is just one). (1 mark)
|
|
- The program can correctly
calculate (using a loop) an exponent when the power is greater than zero. (2
marks)
|