Answer questions about the 3 function prototypes below.
long int Factorial(int );
double FindAverage(double , int );
void PrintTitle(string , int , int );
1. What type of value will each function return?
Factorial __long integer___
FindAverage __double______
PrintTitle __nothing is returned__
2. How many arguments does each function expect?
Factorial _____one__________
FindAverage _____two__________
PrintTitle ______three________
3. Write a calling statement for each function using constant values as arguments. (Use values like 1, 2, 3.5, "Mary", not num1, name etc.)
Factorial ____answer = Factorial(7);______________________
FindAverage ___average = FindAverage(1234.78, 23);________
PrintTitle _____PrintTitle("INVOICE", 82, 4);___ ____________
NOTE that Factorial and FindAverage are assignment statements because they return a value. If they are not called with an assignment statement the returned value is lost. PrintTitle does not need an assignment. It does its job and returns.
4. Write a calling statement for each function using variables as arguments.
The following variables would be declared in the calling function, not the function being called.
int num1, column, row, count; double sum; string name;
Factorial ____answer = Factorial(num1);___________________
FindAverage ___average = FindAverage(sum, count);__________
PrintTitle _____PrintTitle(name, column, row);________________
NOTE: When you call a function you do not need to know the variable names that the function uses for the arguments.