1.Answer the questions below about this function prototype: double coinTotal (do
ID: 3873610 • Letter: 1
Question
1.Answer the questions below about this function prototype:
double coinTotal (double coinValue, int nCoins);
What is the type of the return value?
How many parameters does the function take? ( )
What is the name of the function? ( )
2.These are defined in the function heading and tell a user what data needs to be sent to a function.( )
3.
What is the term used for a variable sent as data in a function call, such as n1 in the example below?
int n1;
int convertedValue = convert(n1);
A)formal parameter
B)formal parameter
C)return type
4.Which statement is correct about a function prototype?
A)
D)A function prototype is always placed after a call to the function.
5.What is the term for using a function?
A)call
B)function
C)use
D)access
6.Which statement is not true about using functions?
It doesn't let you break up your program into different files.
7.
For the function and function call shown below, which statement is true about the relationship between n1 and valueToConvert?
int n1;
int convertedValue = convert(n1);
int convert (int valueToConvert)
{
// function body is here
}
A)n1 and valueToConvert point to the exact same location in memory
B)n1 is a copy of valueToConvert
A function prototype is always optional.Explanation / Answer
1. Type of return value- double
The function takes 2 parameters
coinTotal is the name of function
2. The data type of parameters is defined in function heading, which tells the user what data needs to be sent to that function.
3. You seem to have mistyped the options. The answer would be actual parameters. n1 here is an example of the same.
4. C option is true. A prototype lets the compiler know about return type and param types.
5. A option. We call a function!
6. D option is the answer. Breaking up a program into different files has nothing to do with functions.
7. C option. The value of n1 will be copied to valueToConvert.
Kindly let me know if you have any doubts in it.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.