Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c++ 26. For optimal aerobic benefit, a person should maintain a heart rate betwe

ID: 3748598 • Letter: C

Question

c++


26. For optimal aerobic benefit, a person should maintain a heart rate betwen 60% and 80% of his or her maximal heart rte-this range is called the aero. bic target zone. A person's maximal heart rate (MHR) is calculated as MHR 220-age, and k percent of maximal heart rate is given by the formula 0.01* k (MHR RP) RP where RP is the person's resting pulse rate Write a program to input a person's age and resting pulse rate; then out- put that person's maximal heart rate and aerobic target zone. The lower and upper pulse rates of the target zone should be accurate to the nearest whole number. (Use an int-valued function to return MHR and a void function to display the lower and upper ends of the aerobic target zone, rounded to the nearest integer.)

Explanation / Answer

#include <iostream>

using namespace std;

void mhr(int age, int rp){
int mhr = 220-age;
int upper = ((0.01*0.8) * (mhr-rp) )+ rp;
int lower = ((0.01*0.6) * (mhr-rp) )+ rp;
cout<<"Upper Bound: "<<upper<<endl;
cout<<"Lower Bound: "<<lower<<endl;
}

int main(){

int age=0, rp;
//Getting the age from user
cout <<"Enter your age: ";
cin>> age;
cout <<"Enter resting pulse rate: ";
cin>> rp;

//Calculating and printing out the upper and lower limits of heart rate
mhr(age, rp);
return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote