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
Elis [28]
3 years ago
11

Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to

the power of the second parameter. Write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Computers and Technology
1 answer:
Mazyrski [523]3 years ago
6 0

Answer:

#include <iostream>

#include <math.h>

using namespace std;

int to_the_power_of(int first, int second){

   

   int result = pow(first, second);

   

   return result;

}

int main()

{

   int side;

  cout<<"Enter the side of cube: ";

  cin>>side;

 

  int volume = to_the_power_of(side, 3);

 

  cout<<"The volume is "<<volume<<endl;

 

  return 0;

}

Explanation:

include the library iostream and math.h for using the input/output instruction and pow() function.

create the main function and declare the variable.

then, print the message for asking to enter the value from user.

the enter value is then store in the variable using cin instruction.

then, call the function with two parameters. program control move to the define function and  calculate the first parameter raised to the power of the second parameter.

then return the result to the main function and finally print the result.

You might be interested in
What is 8 hours, 5 minutes, 22 seconds minus (-) 7 hours, 24 minutes, 37 seconds?
olga_2 [115]

Answer:

Enter time 1 HH:MM:SS8:5:22                                                                                                    

Enter time 2 HH:MM:SS7:24:37                                                                                                  

0:40:45

Explanation:

The program for above in Python is:

from datetime import datetime

s1 = input("Enter time 1 HH:MM:SS")

s2 = input("Enter time 2 HH:MM:SS")

Format1 = '%H:%M:%S'

tdiff = datetime.strptime(s1, Format1) - datetime.strptime(s2, Format1)

print(tdiff)

We are using the datetime class in datetime module for using strptime to find the difference between the two times.

3 0
4 years ago
Because of their reasonable cost and print quality ___ printers are used in homes and schools
serious [3.7K]

'INK-JET'
because of their reasonable cost and print quality ___ printers are used in homes and schools

7 0
4 years ago
Your teacher needs to keep track of a biology experiment's results for all students, to help calculate the grades. Which applica
IRISSAK [1]

Answer:

I think notepad is best suited for this task...

3 0
3 years ago
Read 2 more answers
The odometer gauge indicates the ________________.
kkurt [141]
<span>The odometer gauge indicates the total number of miles that a car has been driven, so the correct answer here is a. This is normally a sealed system, so that when a vehicle is sold from one party to another, the mileage driven figure can be trusted.</span>
7 0
4 years ago
Read 2 more answers
In this lab, you complete a prewritten Python program for a carpenter who creates personalized house signs. The program is suppo
ivolga24 [154]

Using the computer language in python to write a function code that personalized house signs

<h3>Writting the code in python:</h3>

<em>#Assign varibles</em>

<em>charge = 0.00</em>

<em>numChars = 8</em>

<em>color = "gold"</em>

<em>woodType = "oak"</em>

<em />

<em>#Checking for number of characters</em>

<em>if numChars > 5:</em>

<em>charge = 35 + (numChars-5)*4</em>

<em>elif numChars > 0:</em>

<em>charge = 35</em>

<em />

<em>#Checking wood type</em>

<em>if woodType == "oak":</em>

<em>charge += 20</em>

<em />

<em>#Checking for color</em>

<em>if color == "gold":</em>

<em>charge += 15</em>

<em />

<em>#Print output</em>

<em>print("The charge for this sign is $"+str(charge)+".")</em>

See more about python at brainly.com/question/13437928

#SPJ1

5 0
2 years ago
Other questions:
  • ____________ markup languages contain sets of directions that tell the browser software how to display and manage a web document
    7·1 answer
  • B. Write a function that takes one double parameter, and returns a char. The parameter represents a grade, and the char represen
    7·1 answer
  • A comma is also called a statement terminator. A. True B. False
    8·1 answer
  • Open Comments.java and write a class that uses the command window to display the following statement about comments:
    8·1 answer
  • What is good prossesser
    15·2 answers
  • According to peacemaking criminology, our society denying a citizen's basic rights is another dimension of
    5·2 answers
  • Did every packet arrive in the correct order? Describe what went wrong and whether your partner was able
    9·1 answer
  • What tag is used to contain information about a web page, such as the title and related pages?
    12·1 answer
  • Which effect is used in this image?
    12·2 answers
  • Write a program that multiplies two hard-coded numbers, then prints the individual numbers out and prints their product out, all
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!