Welcome to Westonci.ca, your go-to destination for finding answers to all your questions. Join our expert community today! Experience the convenience of getting reliable answers to your questions from a vast network of knowledgeable experts. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.
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);
}
}
We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Thanks for using our platform. We aim to provide accurate and up-to-date answers to all your queries. Come back soon. We're dedicated to helping you find the answers you need at Westonci.ca. Don't hesitate to return for more.