My program specifications are as follows. 1. All four digits are different 2. The digit in the thousands place is three times the digit in the tens place 3. The number is odd. 4
boolean found = false;
while (found)
This alone ensures the while loop will never be entered, since found
is false. Anything inside the while loop doesn't make any difference, since it will never be executed.
You probably meant to write
while (!found)
Beside this error, your conditions are over complicated. Here's how you can simplify them :
if ((position0 == (3 * position2)) && // note that position0 is the "thousands place", not position3
((position0+position1+position2+position3) == 27) && // sum of digits
(position3 % 2 == 1) && // odd number
(position0 != position1 && position0 != position2 && position0 != position3 &&
position1 != position2 && position1 != position3 && position2 != position3)) { // different digits
found = true;
}