Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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? cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Window Functions For Data Analysis And Beyond

Authors: Itzik Ben Gan

2nd Edition

0135861446, 978-0135861448

More Books

Students also viewed these Databases questions

Question

Compare the different types of employee separation actions.

Answered: 1 week ago

Question

Assess alternative dispute resolution methods.

Answered: 1 week ago

Question

Distinguish between intrinsic and extrinsic rewards.

Answered: 1 week ago