<commit_before>/*   ./src/bmi_calculator.js
     Is called by ./src/person.js
*/


function BMICalculator() {
}


BMICalculator.prototype.find_bmi_of = function(obj) {
  var height = person.height;
  var weight = person.weight;
  var toggle = person.toggle;

  if (weight > 0 && height > 0 ) {
    var calc_height = 0;
    var toggle_factor = 0;
    var height_divisor = 0;

    if ( toggle === true ) {
      calc_height = height * 12;
      toggle_factor = 703;
      height_divisor = 1;
    }
    if ( toggle === false ) {
      calc_height = height;
      toggle_factor = 1;
      height_divisor = 100;
    }
    var finalBmi = weight * toggle_factor / Math.pow((calc_height/height_divisor), 2);
    obj.bmiValue = parseFloat(finalBmi.toFixed(2));
    //setBMIMessage(obj);
  }
};


/*function setBMIMessage (obj, value) {
  if (obj.bmiValue < 18.5) {
    obj.bmiMessage = "Underweight";
  }
  if (obj.bmiValue >= 18.5 && obj.bmiValue < 25) {
    obj.bmiMessage = "Normal";
  }
  if (obj.bmiValue >= 25 && obj.bmiValue < 30) {
    obj.bmiMessage = "Overweight";
  }
  if (obj.bmiValue >= 30) {
    obj.bmiMessage = "Obese";
  }
}*/


function setBMIMessage (obj, value) {
  switch (obj.value) {
    case (obj.value < 18.5):
      obj.bmiMessage = "Underweight";
      break;
    case (obj.value >= 18.5 && obj.value < 25):
      obj.bmiMessage = "Normal";
      break;
    case (obj.value >= 25 && obj.value < 30):
      obj.bmiMessage = "Overweight";
      break;
    case (obj.value >= 30):
      obj.bmiMessage = "Obese";
      break;
    default:
      obj.bmiMessage = "Invalid BMI value.";
  }
}<commit_msg>all tests succeed. time to start with acceptance testing<commit_after>/*   ./src/bmi_calculator.js
     Is called by ./src/person.js
*/


function BMICalculator() {
}


BMICalculator.prototype.find_bmi_of = function(obj) {
  var height = person.height;
  var weight = person.weight;
  var toggle = person.toggle;

  if (weight > 0 && height > 0 ) {
    var calc_height = 0;
    var toggle_factor = 0;
    var height_divisor = 0;

    if ( toggle === true ) {
      calc_height = height * 12;
      toggle_factor = 703;
      height_divisor = 1;
    }
    if ( toggle === false ) {
      calc_height = height;
      toggle_factor = 1;
      height_divisor = 100;
    }
    var finalBmi = weight * toggle_factor / Math.pow((calc_height/height_divisor), 2);
    obj.bmiValue = parseFloat(finalBmi.toFixed(2));
    setBMIMessage(obj);
  }
};


function setBMIMessage (obj, value) {
  if (obj.bmiValue < 18.5) {
    obj.bmiMessage = "Underweight";
  }
  if (obj.bmiValue >= 18.5 && obj.bmiValue < 25) {
    obj.bmiMessage = "Normal";
  }
  if (obj.bmiValue >= 25 && obj.bmiValue < 30) {
    obj.bmiMessage = "Overweight";
  }
  if (obj.bmiValue >= 30) {
    obj.bmiMessage = "Obese";
  }
}


/*function setBMIMessage (obj, value) {
  switch (obj.value) {
    case (obj.value < 18.5):
      obj.bmiMessage = "Underweight";
      break;
    case (obj.value >= 18.5 && obj.value < 25):
      obj.bmiMessage = "Normal";
      break;
    case (obj.value >= 25 && obj.value < 30):
      obj.bmiMessage = "Overweight";
      break;
    case (obj.value >= 30):
      obj.bmiMessage = "Obese";
      break;
    default:
      obj.bmiMessage = "Invalid BMI value.";
  }
}*/
{'fraction_non_alphanumeric': 0.14687022900763358, 'fraction_numerical': 0.02748091603053435, 'mean_word_length': 2.463002114164905, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3180251', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1175, 'n_words': 264}