The "odd/even factorial" of a positive integer n is represented as n and is defined non-recursively as: (n)(n-2)(n-4)...(4)(2) i
f n is even and is (n)(n-2)(n-4)...(5)(3) (1) if n is odd. For example 7 equals 7*5*3*1 or 105 and 6 equals 6*4*2 or 48. Come up with a recursive definition for n and use it to guide you to write a method definition for a method called oddevenfact that recursively calculates the odd/even factorial value of its single int parameter. The value returned by oddevenfact is a long..
The function definition to this question can be described as follows:
long oddevenfact(int y) //defining a method oddevenfact
{
//defining conditional statement
if (y>2) //check value is greater then 2
{
return( oddevenfact(y-2) * (long) y); //return value
}
else //else
{
return((long) y); //return its value
}
}
Explanation:
The description of the above method definition can be described as follows:
In the above method definition a long method "oddevenfact" is declared, which accepts an integer variable "y" as its arguments, and return value as long.
Inside the method, a conditional statement is used, in if the block, it checks a value, that is value is greater then 2, and inside the block, a recursive function is used, that calculates its factor, and returns its value in long type.
If the condition is not true, it will go to else block and return in long type value.
The answer is : True. An audit trail is a record of how a transaction was handled from input through processing and output. An audit trail is the evidence, such as purchase orders and invoices, that a financial transaction actually occurred.