Question: 1. (2 points) main 0 is a function. a. true b. false c. it depends on how you define it 2. (2 points) A function

1. (2 points) main 0 is a function. a. true b. false c. it depends on how you define it 2. (2 points) A function knows about the calling code. a. something b. nothing c. everything 3, ( 2 points) Every function must return a value. a. true b. false 4. ( 2 points) It is legal and acceptable to have two local variables in two different functions with the same name and the same data type. a. true b. false c. only if they always have different values d. only if they always have the same value 5. (2 points) With what we have learned so far about C++ functions, a function can directly (i.e. by itself, not as a consequence of an assignment statement in the calling function) alter in the calling function a. no values b. at most 1 value c. 1 or more values 6. (2 points) Write a function prototype for a function called findLarge. It takes two integers as its arguments and returns an integer. 7. ( 2 points) Write a function header for a function called findLarge. It takes two integers as its arguments (named vall and val2) and returns an integer. 8. ( 2 points) Write a complete function called findLarge that will return the larger of two integers. It takes two integers (the values to be compared) as its arguments. 9. (2 points) Write a complete function called calcTriArea that will calculate and return the area of a triangle. It takes two float/double values: the base and height as its arguments. The area of a triangle is one-half the base times the height. 10. (2 points) A function exists called calc 0 . It takes two integer arguments and returns a real result. Assume the following declarations: int a=4,b=5; Write a single statement that will print the result of calling calc with these arguments. 11. ( 2 points) If a function takes two integer arguments it a. must return an int b. must return a numeric value of some kind c. can return any valid data type
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
