Answer:
- the notation while(!found) { ... } is semantically very clear
- you can initialize the found boolean as false
Explanation:
Within the while loop you will assign the compound condition to the 'found' variable. By initializing the variable with 'false' you ensure that the values used in the compound condition are valid.
Simplified example: read user input until 'Y' is pressed:
found = false;
while(!found) {
userInput = readUserInput();
found = (userInput == 'Y');
}