1. You are writing a function that you need to test but you do not have the access to the entire program. What type of function might you need to create until the entire program is complete?
a. nested
b. driver
c. local
d. stub
e. none of the above
2. Write a single C++ expression that will calculate: (3x + y)^5 and have it store as variable A
Please find below code and explanation and don't forget to give a Like.
1)
b. Driver function would help for this issue.
2)
Code for single c++ expression:
#include <iostream>
#include<cmath>
using namespace std;
int main()
{ int a,x,y;
cout<<"Enter x and y values:";
cin>>x>>y;
// pow(base,power) will calculate the value and will assign it
into a
a=pow(((3*x)+y),5);
cout<<"The value of a is "<<a;
return 0;
}
Output:
Get Answers For Free
Most questions answered within 1 hours.