16. Training Heart Rate In order for exercise to be beneficial to the cardiovasc
ID: 3775653 • Letter: 1
Question
16. Training Heart Rate
In order for exercise to be beneficial to the cardiovascular system, the heart rate (number of heart beats per minute) must exceed a value called the training heart rate, THR. A person's THR can be calculated from his or her age and resting heart rate (pulse rate when first awakening as follows:
(a) Calculate the maximun heart rate as 220 - age.
(b) Subtract the resting heart rate from the naximum heart rate.
(c) Multiply the result in step (b) by 60%, and then add the resting heart rate.
Write a program to request a person's age and resting heart rate as input and display his or her THR. Must use user defined functions.
Explanation / Answer
#include<stdio.h>
#include<stdlib.h>
float thr(int age, int rate);
int main(){
int age=0;
int rate=0;
float t;
printf("Enter the age");
scanf("%d",&age);
printf("Enter the resting heart rate");
scanf("%d",&rate);
t=thr(age,rate);
printf("The training heart rate =%f ",t);
}
float thr(age,rate){
int maxhr, h, hr;
maxhr=220-age;
hr=maxhr-rate;
h=(hr*0.6)+rate;
return h;
}
Example:
Enter the age23
Enter the resting heart rate123
The training heart rate =167.000000
Enter the age34
Enter the resting heart rate90
The training heart rate =147.000000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.