Question: create a c + + program. We are going to make 3 math functions today. 1 . Create the pow ( power ) function in

create a c++ program. We are going to make 3 math functions today.
1. Create the pow (power) function in myMath.h
[kslott@empress cs111] emacs myMath.h
/************************************** function comment
b is base explain what each parameter is
e is exponent
This function will return the answer of b^e explain what the function does and returns
**************************************/
int pow(int b, int e)
{
}
2. Compile myMath.h.
[kslott@empress cs111] g++ myMath.h
If you have errors, fix them.
3. Test your pow function in the main.
[kslott@empress cs111] emacs testMyMath.cpp
//testMyMath.cpp
#include
using namespace std;
#include myMath.h//This line will be replaced by all the code from myMath.h
int main()
{//Explore different ways to call functions
cout << pow(2,3)<< endl; 8// You can call the function in a cout.
// You will see what the function returns.
int ans = pow(5,2); // Storing what the function returns into a variable ans.
cout << ans << endl; 25
int base, power;
cout <<Enter base: ;
cin >> base;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!