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 pkg777;
- import java.util.Scanner;
- /**
- *
- * @author lab5-pc5
- */
- public class Main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- String apellido, nacionalidad;
- int edad;
- Scanner teclado = new Scanner(System.in);
- System.out.print("Ingrese su apellido: ");
- apellido = teclado.next();
- System.out.print("Ingrese su Nacionalidad: ");
- nacionalidad = teclado.next();
- System.out.print("Ingrese su edad: ");
- edad = teclado.nextInt();
- if (edad>=18 && nacionalidad.equals("Ecuatoriana"))
- System.out.println("La persona puede sufragar");
- else
- System.out.println(apellido+" no puede sufragar");
- }
- }
Add Comment
Please, Sign In to add comment