Write the definition of a function powerTo which recieves two parameters, a double and an integer. If the second parameter is po
sitive, the function returns the value of the first parameter raised to the power of the second. Otherwise, the function returns 0.
1 answer:
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;
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!
You might be interested in
Answer:
user_num = 9
while user_num > -1:
print("Body")
user_num = int(input())
print("Done")
If this answer helped consider rating and marking brainliest :)
F5 key on your keyboard in word and power point if that is what you are referring to.
Answer:
I'm pretty sure its A
Explanation:
The Media it the biggest platform rn
<span>A. Military Spending</span>