Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Qs For all multiple choice questions: circle the best answer: Value-returning functions-?- a. can return numbers only b. can return one value only 8,
C++ Qs
For all multiple choice questions: circle the best answer: Value-returning functions-?- a. can return numbers only b. can return one value only 8, c. an return one-or-more values d. if the value is int, they must return 0; 9. A function header specifies_?_ a. b. The data type of the function's return value (if any) the name of the function c. d. The function's parameters (if any) all of the above 10. Which of the following is false? a. The number of arguments should agree with the number of parameters b. The data type of each argument should match the data type of its corresponding parameter. c. The name of each argument should be identical to the name of its corresponding parameter d. void functions do not return a value. 11. Which of the following is a valid function header for a getFee function, which receives an integer first and a floating-point number second. The function returns a floating point number. a. void getFee (int base, double rate); b. double getFee (int base, double rate); c. double getFee (double rate, int base) d. double getFee (int base, double rate) 12. Which of the following is a valid function prototype for the getFee function in question 11, which receives an integer first and a floating-point number second. The function returns a floating point number a. void getFee (int base, double rate); b. double getFee (int base, double rate); c. double getFee (double rate, int base) d. double getFee (int base, double rate) 13. Given: int main() int base, baseAmount; double rate, feeRate, fee; Which of the following are valid calls of the getFee function from questions 11 and 12? For any that aren't valid. WHY aren't they valid? a. getFee (int baseAmount, double feeRate); b. getFee (baseAmount, feeRate); c, fee -getFee (int base, double rate); d. fee getFee (int, double); e. fee getFee (baseAmount, feeRate); f. fee getFee (rate, base); g. fee getFee (base, rate); h. double fee getFee (baseAmount, feeRate); 14. What is wrong with the following function? void Square (int x) x=x*x; return x; Answer: 15. Given the following function: int strange(int x, int y) if (x > y) return x + y; else return x - y; what is the output of the following statement? coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started