1. ## Assistance with problem

Write a program to calculate target heart rate during fitness training. This program has two functions: main and heartRateCalculator. Please do the following:
(a) In the main function, ask the user to enter age and resting heart rate.
(b) In the main function, invoke the heartRateCalculator function. Pass the age and resting heart rate as arguments.
(c) In the heartRateCalculator function, write code to calculate target heart rate during fitness training with the following formula: Target hart rate = (220 – age – resting heart rate) * 0.4 + resting heart rate
Display target heart rate.
(d) Don’t forget to write the necessary function prototype statement.

My program
Code:
```#include <cstdlib>
#include <iostream>
using namespace std;
void heartRateCalculator (double,double);
int main()
{
double age = 0.0;
double restingHeartRate = 0.0;
double heartRateCalculator = 0.0;
double TargetHeartRate= 0.0;

cin >> age;
cout << "What is your resting heart rate?:";
cin >> restingHeartRate;
heartRateCalculator (age,restingHeartRate);

system("pause");
return 0;
}

void heartRateCalculator (double age,double restingHeartRate)
{
double heartRateCalculator = 0.0;

TargetHeartRate = (220-age-restingHeartrate)*0.4 + restingHeartRate;
cout << "Target Heart Rate:" << TargetHeartRate <<endl;

}```

2. > double TargetHeartRate= 0.0;
Move this line inside your function.

Next time, ask an actual question (you know, it ends with a ?).
Don't just dump your assignment and code, and hope we can guess what you're thinking.

3. (d) Don’t forget to write the necessary function prototype statement.
Really?

4. Am I the only one who thinks this is a bad function prototype.

Code:
`void heartRateCalculator (double,double);`
I think this would be better in most ways.

Code:
`double heartRateCalculator (double age, double restingHeartRate);`
Tim S.