import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class VerificarDonante {
public static void main(String[] args) {
String motivo1 = "Motivo: Debe tener entre 18 y 65 años.";
String motivo2 = "Motivo: Debe pesar más de 50 kg";
String compatible = "El donante es compatible.";
String noCompatible = "El donante no es compatible.";
List<String> resultado = new ArrayList<>();
Scanner scanner = new Scanner(System.in);
System.out.print("Ingrese la edad del donante: ");
int edad = scanner.nextInt();
System.out.print("Ingrese el peso del donante (en kg): ");
int peso = scanner.nextInt();
if (edad >= 18 && edad <= 65) {
if (peso >= 50) {
resultado.add(compatible);
} else {
resultado.add(noCompatible);
resultado.add(motivo2);
}
} else {
resultado.add(noCompatible);
resultado.add(motivo1);
}
System.out.println("\n-----RESULTADO");
for (int i = 0; i < resultado.size(); i++) {
System.out.println(resultado.get(i));
}
scanner.close();
}
}