jueves, 27 de febrero de 2020

3

/*
* 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 programa.pkg2;
import java.util.Scanner;
/**
*
* @author Delgado Gustavo
*/
public class Programa2 {

   /**
    * @param args the command line arguments
    */
   public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       System.out.println("Captura el nombre: ");
        String f=sc.next();
       System.out.println("Captura el apellido paterno: ");
        String j=sc.next();
        System.out.println("Captura el apellido materno: ");
        String n=sc.next();
       System.out.println("Captura la edad: ");
        byte k=sc.nextByte();
       System.out.println("Captura el genero: ");
        String p=sc.next();
       System.out.println("Sus datos son : ");
       
       System.out.println(j+ " "+n+" "+f );
       
       if(k>=18){
         System.out.println("sr o Sra");  
       }
       if(k>=13 && k<=17){
         System.out.println("Joven o Srita");  
       }
      if(k<=12){
         System.out.println("niño o niña ");  
       }
       
      int año=2020-k;
      System.out.println("usted nacio en el año:  "+año);  
     
       // TODO code application logic here
   }
   
}

No hay comentarios.:

Publicar un comentario