Advertisement
Hello-Sweety

Untitled

Jan 23rd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package devoir1;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11. *
  12. * @author Benjamin
  13. */
  14. public class Devoir1 {
  15.  
  16. /**
  17. * @param args the command line arguments
  18. */
  19. public static void main(String[] args) {
  20. int age;
  21. String nom;
  22. String prenom;
  23.  
  24. Scanner clavier = new Scanner(System.in);
  25.  
  26. System.out.println("VEuillez saisir votre Nom :");
  27.  
  28. nom = clavier.nextLine();
  29.  
  30. System.out.println("Veuillez saisir votre Prenom : ");
  31.  
  32. prenom = clavier .nextLine();
  33.  
  34. System.out.println("Veuillez saisir votre age");
  35.  
  36. age = clavier.nextInt();
  37.  
  38. // System.out.println("Vous vous appelez "+nom+ " "+prenom+" et êtes agés de "+age+"ans");
  39.  
  40. if (age <=0){
  41.  
  42. System.out.println("Arreter de vous foutre de moi"+nom+prenom);
  43. }
  44.  
  45. else if (age >= 18 && age<21){
  46. System.out.println(nom+prenom+"vous avez"+age+"ans vous êtes donc majeur , mais pas partout dans le monde");
  47. }
  48.  
  49. else if (age>=21){
  50. System.out.println(nom+prenom+"vous avez"+age+"ans vous avez donc la majorité absolue");
  51. }
  52. else{
  53. System.out.println(nom+prenom+"vous avez"+age+"ans vous êtes donc mineur");
  54. }
  55. }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement