Question
Write the method header (and only the method suggested for the method suggested below which most makes for each of the five questions listed below. a. A method that simply prints the message "Hello" on a line by itself. b. A method which given two integers returns the average of the two numbers c. A method which given the probability of a certain event (in double) will return whether or not the event has taken place. d. A method that prints the decimal equivalent of the bmi given the height and weight of the person in question. e. A method that given a boolean, integer, and a double returns the integer multiplied by the double provided the boolean is true, otherwise it returns the integer unchanged.
Explanation / Answer
printf("%s", "Hello");
return 0;
}
2. int avg(int a, int b)
{
return (a+b)/2.0;
}
4. void bmi(float w, float h)
{
float bmi = w / (h*h);
printf("%f", bmi);
}
5. int multOnBool(int a, flaot b, bool c)
{
if(c == true){
return (a*b);}
else{
return a;}
}