1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Zolol [24]
4 years ago
13

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.
Computers and Technology
1 answer:
FrozenT [24]4 years ago
5 0

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
Write an expression that executes the loop body as long as the user enters a non-negative number.
Grace [21]

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 :)

7 0
2 years ago
Read 2 more answers
Which function key will help you find the word and replace
MaRussiya [10]

F5 key on your keyboard in word and power point if that is what you are referring to.


3 0
3 years ago
Which is one of the modes of game advertising?
-BARSIC- [3]

Answer:

I'm pretty sure its A

Explanation:

The Media it the biggest platform rn

7 0
3 years ago
Read 2 more answers
Non-Discretionary Items will increase or decrease without any action by Congress or the President. Which of the following is NOT
Alex_Xolod [135]
<span>A. Military Spending</span>
7 0
4 years ago
A ______ is an exact duplication of the hard drive, including data files, system files, and settings, application files, and the
olganol [36]
A full system backup
7 0
4 years ago
Other questions:
  • Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, pr
    5·2 answers
  • 2. Identify the diagram and define it.<br>13. What are pollen grains ?<br>4. What is an embryo?​
    12·1 answer
  • Describe the components of series-parallel circuit
    14·1 answer
  • What does the hard disk drive do?
    9·2 answers
  • When you select Insert and click on a shape the mouse pointer turns into a/an
    12·2 answers
  • Which term describes a process by which malicious code can enter from a non-secure network, and make a hairpin, or sharp turn, a
    6·1 answer
  • What’s the difference between the logical and physical structure of a file? What are the advantages of not having an application
    15·1 answer
  • When Russ opened a website on his browser, he saw an error that the site was not compatible with the browser version he was runn
    12·1 answer
  • HELP!!! Bad things about Helen Keller. I'm doing a debate and i need to prove that Steve Jobs is better than Helen Keller!!
    14·1 answer
  • ____coping skills are instinctive.<br> A. All<br> B. No<br> C. Some
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!