1. For the following function headers, determine the number, type, and order(sequence) of the values that must be passed to the function: a. void factorial(int n) b. void power(int type, double induct, double cap) c. void flag(char type, double current, double time) d. void tot
1. For the following function headers, determine the number, type, and order(sequence) of the values
that must be passed to the function:
a. void factorial(int n)
b. void power(int type, double induct, double cap)
c. void flag(char type, double current, double time)
d. void total(double amount, double rate)
e. void getVal(int item, int iter, char decflag, char delim)
2. Write function headers for the following:
a. A function named check() that has three parameters. The first parameter should accept an
integer number, and the second and third parameters should accept a double-precision number.
The function returns no value.
b. A function named findAbs() that accepts a double-precision number passed to it and returns
its absolute value.
c. A function named mult() that accepts two floating-point numbers as parameters, multiplies
these two numbers, and returns the result.
d. A function that produces a table of the numbers from 1 to 10, their squares, and their cubes. No
arguments are to be passed to the function, and the function returns no value.
e. Write a function named rightTriangle() that accepts the lengths of two sides of a right
triangle as the arguments a and b. The function should determine and return the hypotenuse, c,
of the triangle. (Hint: Use Pythagoras’ theorem,
)
3. Write a function named check() that has three parameters. The first parameter should accept an
integer number, and the second and third parameters should accept a double precision number. The
function body should just display the values of data passed to the function when it’s called.
(Note: When tracing errors in functions, having the function display values it has been passed is
helpful. Quite often, the error isn’t in what the function body does with data, but in the data received
and stored.)
4. Write a function named findAbs() that accepts a double-precision number passed to it, computes
its absolute value, and displays the absolute value.
A number’s absolute value is the number itself, if the number is positive and the negative of the
number, if the number is negative.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps