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
Pa help please I need help<br>10 points :'(<br>nonsense report:<br>1 heart​
tatuchka [14]

Answer:

√ 1. Cellphone

<h3>Product Description:</h3>

A cellphone is any portable telephone that uses cellular network technology to make and receive calls.

7 0
3 years ago
What is profession explain with example​
WARRIOR [948]

Answer:   a profession is a job, or what you do for a living

example : a teacher is an example of proffesion

4 0
3 years ago
Read 2 more answers
In three to five sentences, explain the function of the computer's operating system.
Sati [7]

Answer:

An Operating System (OS) is an interface between a computer user and computer hardware. An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Explanation:

3 0
3 years ago
Code a program that gets all possible solutions of a string using 3 for loops. Actual question attached
Nikitich [7]

\tt x=int(input("Enter\:first\:no:"))

\tt y=int(input("Enter\:second\:no:"))

\tt z=int(input("Enter\:third\:no:"))

\tt for\:x\:in\: range (3):

\quad\tt for\:y\:in\:range(3):

\quad\quad\tt for\:z\:in\:range(3):

\quad\quad\quad\tt if\:x!=y\:and\:y!=z\:and\:z!=x:

\quad\quad\quad\quad\tt print(x,y,z)

8 0
2 years ago
The term _____ refers to computers that are among the fastest of any in the world at the time of their introduction. mainframes
Studentka2010 [4]

Answer:

The answer is "Supercomputers".

Explanation:

A supercomputer is a device with or near the highest computer operating price. These computers have typically used in scientific and technical systems with huge libraries or amounts of computing. It applies to machines, that are at the time of their launch are one of the fastest in the world, and the incorrect option can be described as follows:

  • A mainframe computer is used in large organizations.
  • A quantum computer is a computing tool that uses experimentally computational systems directly.
  • The supermini and mini super, both computers are used in researches.
6 0
3 years ago
Other questions:
  • In steps<br> Urgent please
    14·1 answer
  • AddAll - Adds all the doubles in the string with each other. Note every double is separated by a semi-colon. AddAll("1.245;2.9")
    6·1 answer
  • What is an identified component of a software program that might allow a hacker or other intruder to gain entry and control of a
    10·2 answers
  • Which tools are found in the Quick Analysis feature? Check all that apply.
    14·2 answers
  • Please tell fast plzzzzzzzz​
    11·2 answers
  • Gabriel's sister called him about a message that suddenly appeared on her screen that says her software license has expired and
    11·1 answer
  • Trojans depend on ________ to spread. A rootkits B self-replication C code injection D social engineering
    14·1 answer
  • In addition to the cost of legal services and the cost of treatment, which of the following are considered direct costs for work
    9·1 answer
  • What are the supercomputers and where are they used? ​
    9·1 answer
  • The ____ line for any e-mail messages you write should clearly state the intention of the e-mail..
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!