Juniper79
10-07-2008, 11:23 PM
So I need some help badly...I don't want anyone to do the assignment for me, but to guide me into figuring it out...I think that I'm over thinking this, but I just can't seem to figure out which codes to use for everything or where to even start...I have tried to read it over and over again, and for some reason I'm just not getting it...
Keep in mind that I'm pretty new to JS, and we are only on the 3rd chapter, I hope someone can help...
Here it is:
The American Heart Association recommends that when you exercise, you stay within 50 to 85 percent of your maximum heart rate. This range is called your target heart rate. One common formula for calculating maximum heart rate is to subtract your age from 220. Create a web page that you can use to calculate your target heart rate. Use a form that contains a text box in which users can enter their age and a command button that uses an "onclick" event handler to call a function named "calcHeartRate(). Within the calcHeartRate(), include a statement that calculates the maximum heart rate and assigns the result to a variable. Use two other statements that calculate the minimum (50%) and maximum (85%) target heart rates. To calculate the minimum target heart rate, you use the the formula "maximum_heart_rate*.5" and to calculate the maximum target heart rate, you use the formula "maximum_heart_rate*.85". After you calculate the minimum and maximum target heart rates, display the result in another text box in the form. For example, for someone 35 years old, the target heart rate text box should display "92 to 157 beats per minute".
Thanks,
Jenn
Keep in mind that I'm pretty new to JS, and we are only on the 3rd chapter, I hope someone can help...
Here it is:
The American Heart Association recommends that when you exercise, you stay within 50 to 85 percent of your maximum heart rate. This range is called your target heart rate. One common formula for calculating maximum heart rate is to subtract your age from 220. Create a web page that you can use to calculate your target heart rate. Use a form that contains a text box in which users can enter their age and a command button that uses an "onclick" event handler to call a function named "calcHeartRate(). Within the calcHeartRate(), include a statement that calculates the maximum heart rate and assigns the result to a variable. Use two other statements that calculate the minimum (50%) and maximum (85%) target heart rates. To calculate the minimum target heart rate, you use the the formula "maximum_heart_rate*.5" and to calculate the maximum target heart rate, you use the formula "maximum_heart_rate*.85". After you calculate the minimum and maximum target heart rates, display the result in another text box in the form. For example, for someone 35 years old, the target heart rate text box should display "92 to 157 beats per minute".
Thanks,
Jenn