I've been having some issues trying to solve this code that my professor sent to me for studying purposes. I usually can solve the isPrime and getPrime no problem but my issue lies with the gcd class. Would love to get some input on this. Thanks :) Sorry for the formatting since i'm new to the site
import java.util.*;
public class Util3
{
public ??? getSmaller(???)
{
int smaller;
if (???)
smaller = ???;
else
smaller = ???;
return smaller;
}
public ??? gcd(??? a, ??? b)
{
int g, smaller;
smaller = ???(a, b);
g = smaller;
for (int i = ???; i >= 1; i++) { // from smaller to 1
if (a % i == 0 ??? ???) {
g = i;
???;
}
}
return g;
}
public ??? isPrime(int p)
{
if (p < 2)
return false;
int i;
for (i = ???; i <= ???; i++) // from 2 to p-1
if (??? == 0) // if p is divisible by i
break;
if (i == ???)
return ???;
else
return ???;
}
public ??? getPrime(int n)
{
boolean b;
int p;
for (p = n+1; ; p++) { // n+1, n+2, ...
b = ???(p); // check if p is a prime number
if (???)
break;
}
return p;
}
}