Write a program that uses a User-Defined Function (UDF) that solves for the value of Y as a function of x in the equation shown below: The equation is an infinite series of terms, so the UDF must use an infinite loop to sum up all the terms in the series, add only all terms greater than 1 x. If the term is already less than 1 x, terminate the infinite loop, print the computed value of the sum of the series as the value of y for that value of x on the 2nd column of the Table and the corresponding value of on the 3rd column of the Table shown below which the program must print. The UDF must be declared to be of type void and will accept the value of x as one of its argument and will return its computed value of Y corresponding to that value of x through its reference parameter, &T. The UDF must be declared as: void Y( double x, double &T), use the built-in function to compute the corresponding value of on the 3rd column of the Table. The UDF must be able to compute for the value of Y corresponding to the value of x from 0.2 to 1.2 in step of 0.2. Sample Table Display: x Y(x) exp(x) 0.2 0.4 0.6 0.8 1.0 1.2
Write a program that uses a User-Defined Function (UDF) that solves for the value of Y as a function of x in the equation shown below:
The equation is an infinite series of terms, so the UDF must use an infinite loop to sum up all the terms in the series, add only all terms greater than 1 x. If the term is already less than 1 x, terminate the infinite loop, print the computed value of the sum of the series as the value of y for that value of x on the 2nd column of the Table and the corresponding value of on the 3rd column of the Table shown below which the program must print. The UDF must be declared to be of type void and will accept the value of x as one of its argument and will return its computed value of Y corresponding to that value of x through its reference parameter, &T. The UDF must be declared as: void Y( double x, double &T), use the built-in function to compute the corresponding value of on the 3rd column of the Table. The UDF must be able to compute for the value of Y corresponding to the value of x from 0.2 to 1.2 in step of 0.2.
Sample Table Display:
x |
Y(x) |
exp(x) |
0.2 |
|
|
0.4 |
|
|
0.6 |
|
|
0.8 |
|
|
1.0 |
|
|
1.2 |
Step by step
Solved in 2 steps with 1 images