Created
May 18, 2024 16:27
-
-
Save duranangie/6b566994086127e92c3a943272842772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package teclado; | |
import java.util.Scanner; | |
public class Teclado { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
String dni; | |
String nombre; | |
int edad; | |
System.out.println("BIENVENIDOS A LA INSCRIPCION DE LA MARATON DEL INMIGRANTE"); | |
System.out.println("Ingrese su dni: "); | |
dni = scan.next(); | |
System.out.println("Ingrese su nombre: "); | |
nombre = scan.next(); | |
System.out.println("Ingrese su edad: "); | |
edad = scan.nextInt(); | |
while (!nombre.equalsIgnoreCase("fin") || !dni.equals("0")) { | |
if (edad >= 6 && edad <= 10) { | |
System.out.println(" el grupo al que pertence es: Menores A"); | |
} else if (edad >= 11 && edad <= 17) { | |
System.out.println("hola "+nombre+" el grupo al que pertence es: Menores B"); | |
} else if (edad >= 18 && edad <= 30) { | |
System.out.println("hola "+nombre+" el grupo al que pertence es: Juveniles"); | |
} else if (edad >= 31 && edad <= 49) { | |
System.out.println("hola "+nombre+" el grupo al que pertence es: Adultos"); | |
} else if (edad >= 50 && edad <= 100) { | |
System.out.println("hola "+nombre+" el grupo al que pertence es: Adultos Mayores"); | |
} else { | |
System.out.println("hola "+nombre+" No pertences a ningun grupo revisa nuevamente tu informacion"); | |
} | |
System.out.println("Ingrese su dni: "); | |
dni = scan.next(); | |
System.out.println("Ingrese su nombre: "); | |
nombre = scan.next(); | |
System.out.println("Ingrese su edad: "); | |
edad = scan.nextInt(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment