Exam 4: Parameters and Overloading

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Write a definition for a void-function that has two int value parameters and outputs to the screen the product of these arguments.Write a main function that asks the user for these two numbers,reads them in,calls your function,then terminates.

(Essay)
4.9/5
(38)

Default arguments can be used with either call-by-value or call-by-reference parameters.

(True/False)
4.8/5
(41)

Which of the following overloadings will be invoked by this call? g(1,2);

(Multiple Choice)
4.7/5
(33)

What is a driver program?

(Essay)
4.7/5
(45)

Call-by-reference is restricted to void functions.

(True/False)
4.8/5
(39)

The fundamental rule for testing functions requires that every function be tested in an already fully tested and debugged program.How can this be accomplished? Give a testing scenario for testing a program with main function that calls several functions.

(Essay)
4.8/5
(45)

Names of parameters in functions,especially function prototypes,have no meaning,and may be selected quite arbitrarily.

(True/False)
4.7/5
(40)

Mixing call-by-reference and call-by-value parameters is strictly prohibited.

(True/False)
4.8/5
(34)

A program should have all of its functions written before testing can begin.

(True/False)
4.9/5
(35)

There is no problem with the compiler distinguishing these two function definitions: void func(double x){/*…*/} int func(double x){/*…*/ return something_double;}

(True/False)
4.8/5
(33)

Write a void function using two type int call-by-reference parameters that swaps the values in the arguments.Be sure to include testable pre and post conditions.

(Essay)
4.7/5
(36)
Showing 21 - 31 of 31
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)