1-A function must be defined or declared above the locations in the source code
ID: 1814749 • Letter: 1
Question
1-A function must be defined or declared above the locations in the source code file from where it is called. We declare a function by writing a function declaration (which is a statement so it ends with a semicolon). Another term for function declaration is ?
2-Write a function declaration for a function named ValidateEyeColor which returns nothing and has one parameter, an int, named choice.
3-Suppose a constant double variable named LB_PER_KG has been defined and initialized to 2.20462262. Let lbs be a double variable that represents a person's weight in pounds. Write an arithmetic expression that would convert the weight in pounds to weight in kilograms, using LB_PER_KG.
4-What C++ Standard Library header file must be included to use the abs() function?
Explanation / Answer
1 ) we can declare by writing the whole function and its statemnts and return values in the same location .
Eg :
void function (int a)
{
//your code
}
2)
void ValidateEyeColor(int parameter)
{
//write your code here
}
or
void ValidateEyeColor(int);
3)
double wight_in_kg = lbs /LB_PER_KG ;
4)
<cmath> should be included to use abs() function
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.