You can continue to work in the previous Calculator
class for this exercise. For this version, more complicated calculations need to be implemented. There might be different solutions for the same problem. You can look online for some help but think of what was said last WPO regarding learning goals and plagiarism!
Make sure the following elements are present in your class:
isPrime(int number).
fibonacciNumber(int N)
. The Fibonacci number is the sum of the two previous Fibonacci numbers. Assume the indexing of the series starts with 0.armstrongNumbers(int number, int power)
. For a given power $$X$$ and a number $$ABCD$$, where $$A$$, $$B$$, $$C$$, $$D$$ are digits, a number is an Armstrong number if $$ ABCD = A^X + B^X + C^X + D^X $$. Note that this number need not be four digits!factorial(ind number)
numberReversal(int number)
productMaximiser(int[] a, int[] b)
. The output should be an array with two integers, each integer is the index of thier respective arrays.Again no main()
method is needed for this exercise!
Adapted from Calculator - CafePress1