Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

import java.util.

Scanner;

public class App {


public static void main(String[] args) throws Exception {
String MotDePasseJuste = "AIPM1";
String MotDePasse;
String OuiNon;
String Reponse;
Scanner Input = new Scanner(System.in);
int attempts;
for (attempts = 2; attempts >= 0; attempts--) {

System.out.print("Enter your password: ");


MotDePasse = Input.nextLine();
if (MotDePasse.contains(MotDePasseJuste)) {
System.out.println("bienvenue");
System.exit(0);
}
else if (attempts==2) {
System.out.println("you have " +attempts +" left " );
}
else if (attempts==1) {
System.out.println("you have "+ attempts +" left " );
}
else if (attempts==0) {

System.out.println("compte bloqué voulez vous regangner l'accées au


compte ?");
OuiNon = Input.nextLine();
if (OuiNon.contains("non")) {
System.exit(0);
}
else if (OuiNon.contains("oui"))
System.out.println("reponder a cette qst : Quelle est votre
spécialité ?");
Reponse = Input.nextLine();
{
if (Reponse.contains("AUTO")) {
System.out.println("bienvenue");

}
else{
System.out.println("accées bloqué");
System.exit(0);
}
}
}

}
}

You might also like