|
- Defines an outline for 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".
(0.2 grade points
for an empty class and an empty 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 to be calculated:
0.2 grade points for the prompt)
the result of each calculated exponent
will be stored as a separate array element - no need to store the
based and the power in the array just store the result. (1
grade point
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 (0.2
grade points
for prompt) either of which can be any non-negative integer.
At this point your program doesn't have to handle type checking
(e.g. a String is entered instead of a number).
|
|
|
- The
program can correctly calculate an exponent when the power is zero
(the result is just one). (1 grade
point)
|
|
|
- The program can correctly
calculate an exponent when the power is greater than zero using a
loop and not a predefined Java method such as the 'pow'
in class Math. (1
grade point)
|
|
- The
number of exponents calculated should match the value entered by the
user. (0.4 grade points)
|