Answer:
Following is the definition of the required function:
def powerTo( double first, int second);
if second > 0;
double result = pow(first,second);
return result;
else
return 0;
Step-by-step explanation:
The explanation for above code is as follows:
- A function named powerTo is defined, having two arguments with data type double and integer respectively.
- A if condition is applied that checks the second parameter.
- If the the condition: second > 0 gets true, a value is returned which is equal to first parameter raised to the second.
- If the condition is if bracket gets false, 0 is returned as a result.
i hope it will help you!