In this program I am supposed to figure out if the integer that the user enters contains a certain digit (in this case 7 and 3), and then return a boolean. So far I have:
public static boolean contains(int num, int x) {
Scanner input = new Scanner(System.in);
int currentLength = numberDigits(num); //method that counts the number of digits in the inputed integer
int digit; // current first digit
int firstNumber = firstNum(num);
boolean digitTrue = false;
while (currentLength > 0 ) {
digit = firstNumber;
if (num == x)
{
digitTrue= true;
} else {
digitTrue= false;
}
}
return digitTrue;
}