/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Larry Wiley :: http://schools.nsd.org/%7Elwiley/ */

function alertwiththr() {
  var rhr = prompt("What is your Resting Heart Rate (RHR) please? (ideally checked first thing in the morning)", "")
  var age  = prompt("And your age?", "")
  var tot = 220 - +rhr+ - age
  var lowfinal = tot *.55 +  +rhr
  var hifinal = tot *.85 + +rhr
  alert("Calculated at 55% and 85% of your Maximal Heart Rate (MHR), your Target Heart Rate is between" +" "+lowfinal+" "+ "and"+" " +hifinal)
}





