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
Paraphin [41]
3 years ago
8

Write code to complete RaiseToPower(). Sample output if userBase is 4 and userExponent is 2 is shown below. Note: This example i

s for practicing recursion; a non-recursive function, or using the built-in function pow(), would be more common.
4^2 = 16
#include
int RaiseToPower(int baseVal, int exponentVal){
int resultVal = 0;
if (exponentVal == 0) {
resultVal = 1;
}
else {
resultVal = baseVal * /* Your solution goes here */;
}
return resultVal;
}
int main(void) {
int userBase = 0;
int userExponent = 0;
userBase = 4;
userExponent = 2;
printf("%d^%d = %d\n", userBase, userExponent, RaiseToPower(userBase, userExponent));
return 0;
}
Computers and Technology
1 answer:
liberstina [14]3 years ago
3 0

Answer:

Replace /* Your solution goes here */ with

RaiseToPower(baseVal, exponentVal-1);

Explanation:

From the question, we understand that the program uses recursion.

The essence of recursion is to call a function from the function itself.

This is done by RaiseToPower(baseVal, exponentVal-1);

Because it passed the baseVal and the exponentVal reduced by 1 to the RaiseToPower function.

This is repeated until exponentVal = 1.

<em>However, I've added the full program as an attachment where I used comments to explain some lines.</em>

Download cpp
You might be interested in
Which memory will be suitable (a) to Run a software (b) to store a software permanently ?
Katena32 [7]

(a) To run a software => RAM

(b) To store a software => ROM

3 0
3 years ago
Which commands are on the right-most side of the Title bar? (From Microsoft Word)
jeyben [28]
<h2>Answer:</h2>

Title bar is the top most bar of a window. As obvious from the name, it has the title of the program in use. It has name of the program or more specifically the name of currently open document is written in this horizontal bar.

The option/commands present in the right most o the title bar are as follows:

  • Close
  • Maximize/Resize
  • Minimize

Close command is needed to exit the program/application. A cross icon is used as close command. Maximize/Resize command helps to expand the window to the screen pane as well as allows the user to adjust the screen of application accordingly. Two squares icon is used as a button for this command. Minimize command helps by shutting the app to the task bar so that it can be expanded/maximized later. A dash/line icon is used as a button for this command.

<h2>I hope it will help you!</h2>

6 0
3 years ago
On CLIENT3, open Windows Explorer as Administrator. Open properties for C:\Program Files and select the Security tab to view the
defon

Answer:

1). Read & execute

2). List folder contents

3). Read

Explanation:

See image

5 0
3 years ago
In a "block" containment strategy, in which the attacker's path into the environment is disrupted, you should use the most preci
Slav-nsk [51]
The containment strategy prevents intruders from removing information assets from the network, and prevents attackers from using the organization's network as a launch point for subsequent attacks.
In a "block" containment strategy, in which the attacker's path into the environment is disrupted, you should use the most precise strategy possible, starting with <span>blocking a specific IP address. Correct answer: C

</span>

8 0
3 years ago
How do you make a ringtone on earsketch
RoseWind [281]

Haven't used earsketch, but here we go.

Answer:

1). Make a track in earsketch, make it like 6/7 seconds

2.) export your track as an .mp3, .wav, or  .ogg (your choice!)

3.) (If on android) Navigate to settings, now search for an entry for ringtone.

4.) If you have no luck, look up how to set ringtone on your desired phone brand (iOS, Android, etc.)

5.) Test out your new ringtone

6.)Profit

4 0
3 years ago
Other questions:
  • The design activity key question, "how will this system interact with other systems..." is part of which design activity?​
    7·1 answer
  • Using physical proximity to gain login information, passwords, or other personal information is known as a(n) ____.
    7·1 answer
  • Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar
    12·1 answer
  • Which of the following is true regarding packaged software and custom software? Group of answer choices Packaged software are ap
    13·1 answer
  • can you give me a tip to fix my SIM card becuaus when i put it on my phone it has no signal , can anyone fix this , thank you.​
    9·2 answers
  • Java uses a right brace to mark the end of all compound statements. What are the arguments for and against this design?
    8·1 answer
  • Un polímero sintético es renovable o no renovable
    11·1 answer
  • Which country has the most common features of analogue and digital computer​
    6·1 answer
  • What are the different types database of end users? Discuss the main activi-ties of each
    6·2 answers
  • During the post process,the Bios uses two different ways to notify you of a problem. Error beep codes and error messages .Explai
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!