Discover the answers you need at Westonci.ca, where experts provide clear and concise information on various topics. Get the answers you need quickly and accurately from a dedicated community of experts on our Q&A platform. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.
Sagot :
Answer:
Explanation:
El codigo solicita los datos y los analiza. Si estan bien continua, sino los vuelve a solicitar. Cuando esten todos los datos bien los imprime.
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Nombre: ");
String nombre = in.nextLine();
int Edad, peso;
while (true) {
System.out.println("Edad: ");
Edad = in.nextInt();
if ((Edad >= 18) && (Edad <= 50)) {
break;
}
}
while (true) {
System.out.println("Peso: ");
peso = in.nextInt();
if ((peso >= 50) && (peso <= 100)) {
break;
}
}
System.out.println("Nombre: " + nombre);
System.out.println("Edad: " + Edad);
System.out.println("Peso: " + peso);
}
}
Thanks for using our service. We aim to provide the most accurate answers for all your queries. Visit us again for more insights. We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Stay curious and keep coming back to Westonci.ca for answers to all your burning questions.