Advertisement
Guest User

Exo Age prénom...

a guest
Jan 23rd, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.40 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 exoduvendredi;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11.  *
  12.  * @author Happy
  13.  */
  14. public class Exoduvendredi {
  15.  
  16.     /**
  17.      * @param args the command line arguments
  18.      */
  19.     public static void main(String[] args) {
  20.         // TODO code application logic here
  21.        
  22.         //Demander un prénom
  23.        
  24.         Scanner sc = new Scanner(System.in);
  25.         String String = sc.nextLine();
  26.                
  27.                 System.out.print (" Entrez votre prénom: ");
  28.                          
  29.         //Demander un âge
  30.        
  31.         int age;
  32.      
  33.        
  34.         Scanner clavier = new Scanner(System.in);
  35.        
  36.         System.out.print("\n Entrez votre âge:");
  37.        
  38.                
  39.         if (clavier.hasNextInt())//blindage du programme contre les double
  40.         { age = clavier.nextInt();
  41.      
  42.             if (age >= 21){
  43.                 System.out.println("Welcome U're major come to the Wonderland");
  44.             } else {
  45.                 System.out.println("\"Buuuh buuh buuuhhh U're maybe major but not in USA so get out of here");          
  46.             }
  47.            
  48.         } else {
  49.             System.out.println("Don't kidding me boy");// ;)
  50.         }
  51.     }
  52.    
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement