Text 1-09/24/2018. Answer the following question: 1.1 Complete the following phrase: If a C++ project employs functions, it is recommended that the following parts are present: the function's call and the function definition."
1.2. If the following is a function call, what are the identifiers between parentheses called?
x = computeAverage(y, z);
1.3. If x, y, and z in the question above are integers, write what the prototype of the function computeAverage should be?
2. For the given code:
#include <iostream>
using namespace std;
void main() {
char gender;
int age;
double HR;
cout << "Please input your age (end with 0): ";
cin >> age;
while (age > 0) {
cout << "Please input your gender (M or F): ";
cin >> gender;
HR = 220 - age;
if (gender == 'M' || gender == 'm') {
HR -= 0.88 * age;
}
cout << "Your maximum normal heart rate is " << HR << endl << endl << endl;
cout << "Please input your age (end with 0): ";
cin >> age;
}
}
Do the following:
2.1 Complete the general comments of this program (in short, state what the program does, what the input and output are)
2.2 Complete the program to validate the gender (it cannot be other than M, m, F, or f)
2.3 Change the program to use this function: double ComputeHR(int, char) // prototype. You have to figure out what the return value and the parameters mean.
Grading Scale: Pb 110+10+15
Pb 215, 15, 25
Format of Submission: 10
Total: 100