You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
917 B
38 lines
917 B
package com.company.bmi;
|
|
|
|
import java.util.Scanner;
|
|
|
|
public class bmiEingabe {
|
|
|
|
|
|
public static void main(String[] args){
|
|
|
|
Scanner scanner = new Scanner(System.in);
|
|
|
|
System.out.println("Bitte geben sie Ihr Gewicht ein: ");
|
|
String gewicht = scanner.nextLine().replace("-", "");
|
|
System.out.println("Bitte geben sie Ihre Größe ein: ");
|
|
String große = scanner.nextLine().replace("-", "");
|
|
|
|
double dGewicht = Double.parseDouble(gewicht);
|
|
double dGroße = Double.parseDouble(große);
|
|
|
|
HealthKlasse HK = new HealthKlasse();
|
|
|
|
double BMI = HK.bmiRechner(dGewicht, dGroße);
|
|
|
|
ausgabe(BMI);
|
|
}
|
|
|
|
public static void ausgabe(double BMI){
|
|
|
|
HealthKlasse HK = new HealthKlasse();
|
|
String klasse = "";
|
|
|
|
klasse = HK.kategorie(BMI);
|
|
|
|
System.out.println("Mit einem BMI von "+BMI+" sind Sie "+klasse+".");
|
|
|
|
}
|
|
}
|