Complete the following function for calculating the value of a number (base) raised to a power. Assume that power is positive.

int raiseTo_power (int base, int power)

int ans;
if (power == ______________ )
ans = ______________ ;
else
ans = ____________ *______________ ;
return ans;
}


```
if (power == 1)
ans = base;
else
>
ans = base * raiseTo_power (base, power-1);
```

Computer Science & Information Technology

You might also like to view...

Which of the following is a less common data field in a recipient list?

A) first name B) phone number C) last name D) date of birth

Computer Science & Information Technology

In the algorithm below, the Display statement for the result is considered output, so on a flowchart, it is placed in a ____.Start   // Declare variables   Declare Numeric age, newAge   // Get user's age   Display "Please enter your age: "   Input age   // Compute age in 10 years   newAge = age + 10   // Display new age   Display "In 10 years, you will be " + newAgeStop

A. rectangle B. parallelogram C. terminal symbol D. annotation box

Computer Science & Information Technology

A password ________ disk stores information about your account so that you can recover your user account and personalized settings

A) setting B) encryption C) cracker D) reset

Computer Science & Information Technology

The command with which you can search for text you want to change, and replace it with something else.

A. Select and Replace B. Find C. Replace

Computer Science & Information Technology