public IntensityHeartrate addHeartRateIntensity(int age, int restingHeartrate, int intensity) { IntensityHeartrate intensityHeartrate = new IntensityHeartrate(); intensityHeartrate.Heartrate = (((220 - age) - restingHeartrate) * intensity / 100) + restingHeartrate; intensityHeartrate.Intensity = intensity; return(intensityHeartrate); }
public ListIntensityHeartrate createModel(int age, int restingHeartrate) { ListIntensityHeartrate list = new ListIntensityHeartrate(); for (var i = 55; i <= 95; i = i + 5) { IntensityHeartrate intensityHeartrate = new IntensityHeartrate(); HeartrateCalculator calc = new HeartrateCalculator(); intensityHeartrate = calc.addHeartRateIntensity(age, restingHeartrate, i); list.ListOfIntensityHeartrates.Add(intensityHeartrate); } return(list); }