Question: Using Java Eclipse Problem 1[50 pts]: Write a program that prompts the user to enter two positive integers named a and b. Then, output the

Using Java Eclipse

Using Java Eclipse Problem 1[50 pts]: Write a program that prompts the

Problem 1[50 pts]: Write a program that prompts the user to enter two positive integers named a and b. Then, output the Bezout coefficients of a, b. Recall that the Bezout coefficients are (any) integers s, t such that: as + bt = gcd(a, b). Problem 2[50 pts]: Write a program that prompts the user to enter three positive integers a, b, n. Then, output the general form of solutions to the congruence equation arb (mod n) if there is such a solution. If there is no solution output "NO SOLUTION" For example, suppose l enter a 2 b 3, n 6 the output should be NO SOLUTION" If on the other hand, I enter a 2.b= 4,n = 6 then the general solution is r 2 (mod 3) so your program outputs r 2 (mod 3) Ffint: Recall that ue have seen hou to solve congruences take arleb (mod n) if geala, Clearly you can check if ged(a,n) 1 and if so you know what to do. If that is not the case hauerer, then first show that the equation has a solution iff db where d-gcd(a n) and in this case it is enough to solve the equation (a/d)(ba) nod (nld) Also conunce yourself uhy gcd a d,n/d) = 1 Not use hou, to solve congruences or the type you have seen m class

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!