mirrored_repositories/BMI-calc-App
import 'dart:math';

class CalculateBMI {
  CalculateBMI({required this.height, required this.weigt});
  final int height;
  final int weigt;
  double _bmi = 20;
  String calculateBMI() {
    _bmi = weigt / (pow(height / 100, 2));
    return _bmi.toStringAsFixed(1);
  }

  String getResult() {
    if (_bmi > 25) {
      return "OVERWEIGHT";
    } else if (_bmi > 18.5) {
      return "NORMAL";
    } else {
      return "UNDERWEIGHT";
    }
  }

  String getInterpretation() {
    if (_bmi > 25) {
      return "You have a higher than normal body weight. Try to exercise more.";
    } else if (_bmi > 18.5) {
      return "You have a normal body weight. Good Job!";
    } else {
      return "You have a lower than normal body weight. You can eat more.";
    }
  }
}
