For the following function headers determine the number type

For the following function headers, determine the number, type, and order (sequence) of the values that must be passed to the function: void factorial (int n) void volts (int res, double induct, double cap) void power (int type, double induct, double cap) void flag (char type, double current, double time) void total (double amount, double rate) void roi (int a, int b, char c, char d, double e, double f) void getVal (int item, int iter, char decflag, char delim)

Solution

1 a) void factorial(int n)

The above function needs one Integer type parameter.

Function Call: facrorial(5);

b) void volts(int res, double induct, dopuble cap)

The above function needs 3 parameters.

The order must be first integer, then double and double.

Function Call: volts(10, 10.5, 20.3);

c) void power(int type, double induct, double cap)

The obove function needs 3 parameters.

The order must be first integer, then double and double.

Function Call: power(20, 11.5, 22.33);

d) void flag(char type, double current, double time)

The obove function needs 3 parameters.

The order must be first character, then double and double.

Function Call: flag(\'a\', 11.5, 22.33);

e) void total(double amount, double rate)

The obove function needs 2 parameters.

The order must be first double, and then double.

Function Call: total(1.5, 2.3);

f) void roi(int a, int b, char c, char d, double e, double f)

The obove function needs 6 parameters.

The order must be first two parameter of type integer, then second two parameter of type character, and then last two parameters of type double.

Function Call: roi(1, 5, \'s\', \'t\', 2.3, 6.8);

g) void getVal(int item, int iter, char decflag, char delim)

The obove function needs 4 parameters.

The order must be first two parameter or type integer and last two parameters of type character.

Function Call: getVal(5, 3, \'r\', \'y\');

 For the following function headers, determine the number, type, and order (sequence) of the values that must be passed to the function: void factorial (int n)

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site