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 input = new Scanner(System.in); | |
System.out.println("Digite o valor de a: "); | |
System.out.print(">"); | |
double a = input.nextDouble(); | |
System.out.println("Digite o valor de b: "); |
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 input = new Scanner(System.in); | |
System.out.println("Digite a altura em metros: "); | |
System.out.print(">"); | |
double altura = input.nextDouble(); |
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.InputMismatchException; | |
import java.util.Scanner; | |
import static java.lang.Math.pow; | |
/* Fórmula báskara para cálculo de raiz de segundo grau | |
ax^2 + bx + c = 0 | |
Fórmula raiz (x) = [-b +/- sqrt(b^2 - 4ac)] / 2a | |
Lido da entrada: a,b,c -> double | |
Saída: valores de x |
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; | |
/* Desafio 03 - Cálculo IMC, Classificação e Peso Ideal | |
### Etapa 01 - obter peso e altura e calcular IMC | |
### Etapa 02 - Classificação de Peso | |
### Etapa 03 - Peso Ideal por IMC limite máximo de 24,90 | |
### Etapa 04 - Faixa de Peso Ideal | |
# Regras | |
Indicar a classificação utilizando na lógica enum e switch | |
Utilizar uma constante ou enum para IMC ideal no valor indicado na etapa 3 |
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; | |
import static java.lang.Math.pow; | |
public class Main { | |
public static void main(String[] args) { | |
double a,b,c,delta,x1,x2; | |
System.out.println("Digite os números de uma equação do segundo grau "); | |
System.out.println("Digite a"); | |
Scanner leitor = new Scanner(System.in); | |
System.out.print(">"); |
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) { | |
System.out.println("Informe a sua altura em m"); | |
Scanner leitor = new Scanner(System.in); | |
System.out.print(">"); | |
double altura = leitor.nextDouble(); | |
System.out.println("Informe seu peso"); | |
System.out.print(">"); |
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 scanner = new Scanner(System.in); | |
System.out.print("Digite o valor de a: "); | |
double a = scanner.nextDouble(); |
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 scanner = new Scanner(System.in); | |
System.out.print("Digite a altura em metros: "); | |
while (!scanner.hasNextDouble()) { | |
System.out.println("entrada invalida .. "); |
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 scanner = new Scanner(System.in); | |
System.out.println("Digite o valor de a: "); | |
double a = scanner.nextDouble(); | |
System.out.println("Digite o valor de b: "); |
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 enum ClassificacaoIMC { | |
MUITO_ABAIXO_DO_PESO, | |
ABAIXO_DO_PESO, | |
PESO_NORMAL, | |
ACIMA_DO_PESO, | |
OBESIDADE_GRAU_I, |