For the following function headers determine the number type

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

Solution

a. int factorial(int n)

   Number of values passed to the function when it is called is :1

Data type of the passed value is integer.

The data type of the value the function returns is integer.

b.) double volts(int res, double induct, double cap)

The number of values passed to this function is: 3

The order of values and types are:integer,double,double

The type of return value of the function is :double

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

the number of values passed to this function are:3

The type and order of values are:integer,double,double

The return type of the value the function returns is : double

d) char flag(char type, float current,float time)

The number of values passed to the function is :3

the order and types of values passed are :single character, floating point value, floating point value

The function returns a value of type :Character

e) int total(float amount,float rate)

The number of values passed to this function when it is called : 2

The order and type of the values are : floating point, floating point

The return type of the function is :integer

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

The number of values passed to the function when it is called is :6

The order and types of values passed are:integer,integer,character, character,floating point,floating point

The return type of the returned value is :float

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

The number of values passed during call is:4

The order and types of values passed are:integer,integer,character,character

This function return type is void, .it means it does not return any value.

For any queries contact me.Thank you.

 For the following function headers, determine the number, type, and order (sequence) of values that should be passed to the function when it\'s called and the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site