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
USPshnik [31]
3 years ago
5

Complete the recursive function raisetopower(). ex: if userbase is 2 and userexponent is 4, then raisedvalue is assigned with 16

(i.e. 2^4). note: this example is for practicing recursion; a non-recursive function, or using the built-in function pow(), would be more common.
Computers and Technology
1 answer:
lesya [120]3 years ago
6 0
Using the property that x^n is x*x^(n-1) you can write a recursive function:

double raisetopower(double x, int n)
{
   if (n <= 0) {
      return 1.0;
   }
   return x*raisetopower(x, n - 1);
}

Note that this crude implementation does not deal with negative or fractional exponents. But it shows recursion.

You might be interested in
Which of the following is true of functions?
Anna11 [10]

Answer:

the answer is D

Explanation:

4 0
3 years ago
Create a Python program that asks the user in which direction to go? north, South East, or West?
QveST [7]

Answer:

huh

Explanation:

adsfghjkhgfdghjfghjkl

7 0
2 years ago
Samira works for a large U.S. company that has factories all over the world. Samira returned to the U.S. after visiting several
Brums [2.3K]

Answer:

a. Transparency

Explanation:

What Samira actually did was Corporate Transparency. Her concerns about health of those people who purchased the company's products is right from the legal and moral point of views. There are several laws protecting consumers in the US. For example The Food and Drug Administration is in charge of ensuring that foods and medicines are safe for their consumption.

6 0
3 years ago
All of the following changes have created an urgent need for centralization except: Select one: a. The Internet boom inspired bu
kifflom [539]

All of the following changes have created an urgent need for centralization except The number of qualified software programmers and PC repair technicians is dwindling

<h3><u>Explanation:</u></h3>

When the processing tasks are carried out on a centralized server it refers to the Centralization. In this type of architecture all the computer systems will be connected to a single server in which all the computational work are performed. The client machines that are connected to the central server will get the resources for computing from the centralized server.

The main reasons for the purpose of centralization includes the following such as the development in the internet that required many computer networks, the basic functioning of the business in which the needed applications are fed on the intranets, the cost associated in the maintenance of personal computers on the single network.

3 0
3 years ago
What data type would you use for a decimal number?* ​
Elan Coil [88]

Answer:

numeric

Explanation:

The decimal data type is an exact numeric data type defined by its precision (total number of digits) and scale (number of digits to the right of the decimal point).

I hope this answers your question.

3 0
2 years ago
Other questions:
  • You took a fantastic photograph that you want to use in the report you're writing using DTP software. To import the photo into y
    6·2 answers
  • 1. In the.js file, write the JavaScript code for this application. Within the click event handlers for the elements in the sideb
    14·1 answer
  • Assume that play_list refers to a non-empty list, and that all its elements are integers. Write a statement that associates a ne
    7·1 answer
  • Sending a employee an email with important criticism represents a problem which communication process
    9·1 answer
  • Which of the following Office Online apps is most effective for creating multi-media presentations
    15·1 answer
  • What happens if the addressed device does not respond due to a malfunction during a read operation?
    11·1 answer
  • A good sentence about art
    9·1 answer
  • Which button in the Sort &amp; Filter gallery of the Data tab would alphabetize from A to Z quickly?
    6·2 answers
  • Explain any two features of a computer​
    15·1 answer
  • Please help me i’ll give you brainlist
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!