Convert the following mathematics expressions to C++ expressions. Use the declarations provided. Indicate the appropriate header file for any library function used. Be sure you initialize any variables whose values you are using to reasonable values for the library functions you are using.
```
int x, y; //declaration for a) and b)
a) y = x 3
b) y <= |x|
double x, y, z, area; //declaration for c) through e).
c) z = x 1.6
d) z = area area
e) p =xy xy
```
a) //no include file necessary for this expression
int y, x = 39; // any value for x
y = x ??x ??x;
//alternate solution using pow function.
#include
using namespace std;
y = pow(x, 3);
b) #include
using namespace std;
int y; int x = -23; // any value for x
y = abs(x);
// or
#include
double y, x = -79.8; // any value for y
y = fabs(x);
c) #include
using namespace std;
double z, x = 2.6;
z = pow(x, 1.6);
d) #include
using namespace std;
double z, area = 144; // here area must not be
// negative
z = area ??sqrt(area);
// the pow function can be used for this:
z = pow (area, 1.5);
e) // no includes are necessary here
double p, x = 3, y = -4;
//any values for x, y except x = y
p = (x * x + y) / (x * x - y);
//specifications can be interpreted to allow
//int variables as well```
```
You might also like to view...
Which is true about web-based application software?
A) It is installed by the computer manufacturer. B) It is always free. C) It is stored completely on a web server instead of your hard drive. D) It does not need an Internet connection.
Networks are often classified by being either peer-to-peer networks or ________ networks
A) One-to-Many B) Client/Client C) Server/Server D) Client/Server