|
- 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 class and method definition)
|
|
-
The program will calculate a number of exponents (user will be
prompted to enter a value between 1 and 10 which determines the
number of exponents calculated: 1 mark for prompt) which
will be stored in an array, each
exponent will be stored as a separate array element. (1 mark
for storing results in a 1D array)
|
|
- For each exponent to be calculated
the program will prompt the user for a base and a power (1 mark
for prompt) 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 an exponent when the power is greater than zero. (1
mark)
|
|
- The
number of exponents calculated should match the value entered by the
user. (1 mark)
|