Guest User

Untitled

a guest
May 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class Main {
  6.  
  7. /**
  8. * @param args
  9. */
  10. public static void main(String[] args) {
  11. System.out.println ("|-------------------------------------------|");
  12. System.out.println ("|Bienvenue sur le bla bla |");
  13. Scanner sc = new Scanner(System.in);
  14. System.out.println ("|Veuillez vous identifiez |");
  15. String str = sc.nextLine ();
  16. System.out.println ("|Bienvenue :" +str+ " |");
  17. System.out.println ("|Veuillez entrez le code secret |");
  18. ArrayList<String> pseudos = new ArrayList<String>();
  19. pseudos.add("3615");
  20. String str1 = sc.nextLine ();
  21. if(pseudos.contains (str1))
  22. System.out.println ("|Le code secret est correct :" +str1+ " |");
  23.  
  24. else
  25. {
  26. System.out.println("|Erreur! |");
  27. return;
  28.  
  29. }
  30.  
  31. String prenom;
  32. char reponse = 'O';
  33. while (reponse == 'O')
  34. {
  35.  
  36. System.out.println("Donnez un prénom : ");
  37.  
  38. prenom = sc.nextLine();
  39.  
  40. System.out.println("Bonjour " +prenom+ " voici votre bouclier");
  41.  
  42. System.out.println("Bouclier initailisé. Voulez vous un autre bouclier ?(O/N)");
  43.  
  44. reponse = sc.nextLine().charAt(0);
  45. }
  46.  
  47. System.out.println("Négation enregistrée");
  48. System.out.println("Veuillez faire attention aux zones à risques, des balles perdues sont toujours désagréables");
  49. }
  50. }
Add Comment
Please, Sign In to add comment