Password and 4 attempts. Execution through while or do while.
-
Asking the user to enter a password.
-
If the password is incorrect, he receives a message that there are 4 attempts left:
- if subsequent incorrect passwords decrease, attempts decrease;
- when there are no more attempts, a message is displayed: "Please try again later.";
-
If the user entered the correct password immediately or after several attempts, he receives the message "Welcome to the site!".
-
Execution without interruptions and reductions.