Describe the working of checksequence method


Problem:

Question 1- Write a getInt() method that takes as input a String prompt and a Scanner, and returns an integer. This method prompts a user for an integer. If the entered value is an integer, then it is returned. If it is not an integer, then this method must re-prompt until an integer is entered.

Question 2- Write a getLucasSequence() method that takes as input integer parameters p, q and n. Where p and q are Lucas parameters as de?ned above and n determines how many Lucas numbers are generated. This method returns an ArrayList of integers: Lpq(0),Lpq(1),Lpq(2),...,Lpq(n)

Question 3- Write a checkSequence() method that takes as input an ArrayList of integers, identi?es the ?rst i that is greater than or equal to 2 for which Lpq(i) ? i^4 and prints out: i : Lpq(i) i^4 If there is no such i, then this method must print out "None found"

Question 4- Write a main() method that uses the methods you have written to receive p, q and n from the user, prints out the resulting Lucas Sequence and then calls checkSequence().

Show the code, demonstrate it works properly and describe what it is doing.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Describe the working of checksequence method
Reference No:- TGS0893777

Expected delivery within 24 Hours