js/calculator.js
// calculates earth years left to live, after age and life expectancy are given
calculates earth years left to live, after age and life expectancy are given
calculates earth years left to live after age and life expectancy are given
yearsLeft(smoker, age) {
    let that = this;
    let result;
    if (that.lifeExpectancy(smoker) - age > 0) {
      result = that.lifeExpectancy(smoker) - age;
    } else {
      result = "You are living over your life expectancy. Are you sure you are not dead?";
    }
    return result;
  }
yearsLeft ( smoker , age ) { let that = this ; let result ; if ( that . lifeExpectancy ( smoker ) - age > 0 ) { result = that . lifeExpectancy ( smoker ) - age ; } else { result = "You are living over your life expectancy. Are you sure you are not dead?" ; } return result ; }
calculates earth years left to live, after age and life expectancy are given
calculates earth years left to live after age and life expectancy are given