/*
 * REPETITION (do-while, post-test): the body runs FIRST, then the decision.
 * The body always runs at least once.
 *
 * Flowchart:
 *   (Start)
 *     -> /Input password/ <----------------------+
 *     -> <!password.equals("java123")?>          |
 *          True  (wrong password) ---------------+   (arrow back up to the body)
 *          False -> /Print "Welcome!"/ -> (End)
 */
import java.util.Scanner;

public class PasswordDoWhile {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String password;

        do {
            System.out.print("Enter password: ");
            password = sc.nextLine();
        } while (!password.equals("java123"));

        System.out.println("Welcome!");
        sc.close();
    }
}
