Which of the following method header represents Function(true, 0, 2.6)? A. void Function( bool b, double d, int c ) B. void Function( bool b, double d, double e ) C. void Function( bool b, int c, double d ) D. b and c

Respuesta :

Answer:

(d) b and c

Explanation:

Given;

Function (true, 0, 2.6)

From the above, the function Function receives three arguments;

=>First argument (i.e true), is of type boolean

=>Second argument (i.e 0), is of type int, float or double since integers are inherently floating point numbers. Therefore 0 can be int, float or double.

=>Third argument (i.e 2.6), is a floating point number and could be of type float or double.

Therefore the method header for the function Function could be any of the following;

i). void Function (bool b, double d, double e)

ii). void Function (bool b, int c, double d)

iii). void Function (bool b, int d, float e)

iv). void Function (bool b, float d, double e)

v). void Function (bool b, double d, float e)

vi). void Function (bool b, float d, float e)

Note:

i. The ordered list above has ii and v in bold form to show that they are part of the options specified in the question.

ii. The letters b, c, d and e specified in the method declaration variations do not matter. Since they are just dummy variables, they can be any letter.

Therefore b and c are a correct representation for the method header.