From 65997dec0dbc2731a67526bd69dd547ca38bda3e Mon Sep 17 00:00:00 2001 From: MSeibert97 Date: Tue, 16 Jul 2019 11:15:20 +0200 Subject: [PATCH] =?UTF-8?q?Der=20f=C3=BCnfte=20Commit.=20Es=20gibt=20nun?= =?UTF-8?q?=20unterschiedliche=20PopUp=20Fenster,=20die=20von=20dem=20Wert?= =?UTF-8?q?=20des=20BMI's=20abh=C3=A4ngen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 43 +++++++++++++++++++++++------------------- src/FitnessTest_M.java | 28 +++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 23 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9617c18..28a4406 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -34,16 +34,15 @@ - - + + - - + @@ -175,16 +174,16 @@ - - - @@ -431,9 +437,8 @@ - - + @@ -443,7 +448,7 @@ - + @@ -521,7 +526,8 @@ - @@ -609,16 +615,15 @@ - - + + - - + diff --git a/src/FitnessTest_M.java b/src/FitnessTest_M.java index c6e0b04..6d93fab 100644 --- a/src/FitnessTest_M.java +++ b/src/FitnessTest_M.java @@ -109,10 +109,30 @@ public class FitnessTest_M extends JFrame { float height = Float.parseFloat(height_tf.getText()); float weight = Float.parseFloat(weight_tf.getText()); int bmi = (int) (weight / (height*height)); - JOptionPane.showMessageDialog(null, - "Ihr BMI: " + bmi, - "Ergebnis", - JOptionPane.WARNING_MESSAGE); + if(bmi < 19) { + JOptionPane.showMessageDialog(null, + "Ihr BMI: " + bmi + " \nUntergewicht!", + "Ergebnis", + JOptionPane.WARNING_MESSAGE); + } + if(bmi >= 19 && bmi <= 25) { + JOptionPane.showMessageDialog(null, + "Ihr BMI: " + bmi + " \nNormalgewicht!", + "Ergebnis", + JOptionPane.WARNING_MESSAGE); + } + if(bmi > 26 && bmi <= 30) { + JOptionPane.showMessageDialog(null, + "Ihr BMI: " + bmi + " \nLeichtes Übergewicht!", + "Ergebnis", + JOptionPane.WARNING_MESSAGE); + } + if(bmi >= 31) { + JOptionPane.showMessageDialog(null, + "Ihr BMI: " + bmi + " \nÜbergewicht!", + "Ergebnis", + JOptionPane.WARNING_MESSAGE); + } } } });