Created
November 22, 2023 09:51
-
-
Save rafarocha/86ccbf7e0746241d513c812ed9f92366 to your computer and use it in GitHub Desktop.
turma-1076-desafio03-feedback-patricia-ferreira.java
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
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner leitor = new Scanner(System.in); | |
System.out.println("Informe sua altura em metros: "); | |
System.out.print("> "); | |
double altura = leitor.nextDouble(); | |
System.out.println("Informe seu peso em Kg: "); | |
System.out.print("> "); | |
double peso = leitor.nextDouble(); | |
double imc = peso / (altura * altura); | |
System.out.printf("O valor do seu IMC é %.2f. ", imc); | |
double imcIdeal = 24.90; | |
if (imc < imcIdeal) { | |
System.out.println("Você está abaixo do IMC ideal."); | |
} else if (imc > imcIdeal) { | |
System.out.println("Você está acima do IMC ideal."); | |
} else { | |
System.out.println("Você está no IMC ideal."); | |
} | |
} | |
} |
Obrigada, Rocha! Vou prestar atenção nos pontos de melhorias.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Revisão
Melhorias
NaN e 0.0
Referências