I need to create a program that will solve an equation using the bisection method. The program should ask the user to enter in two bounds a,b. Here is the code that I have for the program so far. Then the program should check and make sure f(a) and f(b) have opposite signs. If they do not then the program should issue an error message, and stop the program. Otherwise use the three stopping criteria which are
1.) find the exact value of the root.
2.) The width of the interval is less than .00001.
3.) The number of iterations is more than 1,000.
Then the program should output the value of x and f(x).
The Program keeps looping so can you tell me if you see something wrong with it. Thanks!
Here is the code I have so far:
Prompt A, B .0001->T 1000->N If y1(A)*y1(B)>0 Then Disp "Bound Bad" Stop End Lbl CA (A+B)/2->M N-1->N If Y1(M)*Y1(B)<0 Then M->A Else M->B End If y1(M)=0 Then Disp "Good Found Value of Root" Stop End If abs(A-B)<T Then Disp A,B Stop End If N<=0 Then Disp "Bad" Stop End Goto CA