Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions