Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package devoir1;
- import java.util.Scanner;
- /**
- *
- * @author Benjamin
- */
- public class Devoir1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- int age;
- String nom;
- String prenom;
- Scanner clavier = new Scanner(System.in);
- System.out.println("VEuillez saisir votre Nom :");
- nom = clavier.nextLine();
- System.out.println("Veuillez saisir votre Prenom : ");
- prenom = clavier .nextLine();
- System.out.println("Veuillez saisir votre age");
- age = clavier.nextInt();
- // System.out.println("Vous vous appelez "+nom+ " "+prenom+" et êtes agés de "+age+"ans");
- if (age <=0){
- System.out.println("Arreter de vous foutre de moi"+nom+prenom);
- }
- else if (age >= 18 && age<21){
- System.out.println(nom+prenom+"vous avez"+age+"ans vous êtes donc majeur , mais pas partout dans le monde");
- }
- else if (age>=21){
- System.out.println(nom+prenom+"vous avez"+age+"ans vous avez donc la majorité absolue");
- }
- else{
- System.out.println(nom+prenom+"vous avez"+age+"ans vous êtes donc mineur");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement