keviinrm7

PUEDE SUGRAGAR; NO PUEDE SUFRAGAR

May 20th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 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 pkg777;
  7. import java.util.Scanner;
  8. /**
  9. *
  10. * @author lab5-pc5
  11. */
  12. public class Main {
  13.  
  14. /**
  15. * @param args the command line arguments
  16. */
  17. public static void main(String[] args) {
  18. // TODO code application logic here
  19. String apellido, nacionalidad;
  20. int edad;
  21. Scanner teclado = new Scanner(System.in);
  22. System.out.print("Ingrese su apellido: ");
  23. apellido = teclado.next();
  24. System.out.print("Ingrese su Nacionalidad: ");
  25. nacionalidad = teclado.next();
  26. System.out.print("Ingrese su edad: ");
  27. edad = teclado.nextInt();
  28. if (edad>=18 && nacionalidad.equals("Ecuatoriana"))
  29. System.out.println("La persona puede sufragar");
  30. else
  31. System.out.println(apellido+" no puede sufragar");
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment