Question: Extra Credit: ( 1 0 points ) Create a Java project, and call it ExtraCredit. Create a Java main class. This class will have a

Extra Credit:
(10 points)
Create a Java project, and call it ExtraCredit. Create a Java main class. This class will have a method
called BinaryModularExponentiation which will accept an array of binary digits, the base number, and
the mod number. This method should apply the binary modular exponentiation algorithm and return the
result to the main method.
Write a method called DecimalToBinary that will convert a decimal number to binary. The main method
will ask the user for a base, an exponent, and a mod number.
(10 points)
The assignment is to write a java program that calls a function called findA_n(int n, int a_0). The first
parameter should be the index in the sequence, and the second parameter should be the initial
condition. Your main() routine should return the result of findA_n() to the console window, and findA_n
should be called 3 times as follows:
findAn(5,0);
findAn(5,1);
findAn(5,2);
The formula for a_n should be a_n =4 a_{n-1}-3.
The output should be the 5 th element of the sequence, a_{5}, where the initial element is 0,1, and 2,
respectively.
Your function must implement recursion, i.e. it must call itself.
 Extra Credit: (10 points) Create a Java project, and call it

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!