Commit 248c1cb
Changed files (1)
src
Q7
src/Q7/Person.java
@@ -1,3 +1,11 @@
+/**
+ * Assignment 2, COMP268 Class: Person.java
+ *
+ * @description A class used to shame a person by calculating a BMI which has no value whatsoever.
+ * @author: mo khan Student ID: 3431709
+ * @date Jul 19, 2019
+ * @version 1.0
+ */
package Q7;
import java.util.*;
@@ -21,13 +29,9 @@ public class Person {
}
public String getCategory(double bmi) {
- if (bmi < 18.5) {
- return "Underweight";
- } else if (bmi < 25.0) {
- return "Normal";
- } else if (bmi < 30.0) {
- return "Overweight";
- }
+ if (bmi < 18.5) return "Underweight";
+ else if (bmi < 25.0) return "Normal";
+ else if (bmi < 30.0) return "Overweight";
return "Obese";
}