Question: For C++ The question is how can I Save results in Array, print results from a function and find and print solutions from a function

For C++

The question is how can I Save results in Array, print results from a function and

find and print solutions from a function

//So here is the code I was doing. Can I use data[i][2] = y1 or y2 something like this to save my result?

For C++ The question is how can I Save results in Array,

#include #include using namespace std;

int main() { double min = -5, max = 5, x = min, step = 0.05, error = 0.1, y1 = 0, y2 = 0; int n = 0;

for (double i = min; i

y1 = pow(x, 2) + x - 4; y2 = -.5 * pow(x, 3) + .2 * pow(x, 2) + (4 * x) - 1; error = abs(y1 - y2);

cout

x = x + step; y1 = 0; y2 = 0; n++;

}

}

Find the solutions to the following system of equations by "iterating". For starters, initialize the following variables: min=-5, max=5, step = .05, error = .1 V1 = x+x-4 Y2 = -.5x+.2x2+4x-1 Write a function that creates a table of x, y1, y2, & error values and stores them in an array. Write a function the prints the table out. Write a function that finds the solutions and prints the solutions. The table will look similar the results below: @ 1 2 3 4 5 16 x= -5.000 X= -4.950 x= -4.900 X= -4.850 X -4.800 X= -4.750 X= -4.700 X= -4.650 X= -4.600 X= -4.550 X= -4.500 X= -4.450 X= -4.400 y_1= 16.ece y_1= 15.552 y_1= 15.110 y_1= 14.672 y_1-14.240 y_1= 13.812 y_1-13.390 y_1= 12.972 y_1= 12.560 y_1= 12.152 y_1= 11.750 y_1= 11.352 y_1= 10.960 y_2= 46.500 y_2= 44.744 y_2= 43.026 y_2= 41.347 y_2- 39.704 y_2= 38.098 y_2- 36.529 y_2= 34.997 y_2= 33.500 y_2= 32.039 y_2= 30.612 y_2= 29.221 y_2= 27.864 error= 30.500 error= 29.192 error- 27.916 error= 26.674 error= 25.464 error= 24.286 error= 23.139 error= 22.024 error- 20.940 error= 19.886 error 18.862 error= 17.869 error= 16.904 18 19 10 11 12

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 Databases Questions!