**[Clear the screen and
introduce the program.]**

ClrHome

Disp
"THIS PROGRAM"

Disp "WILL FIND THE"

Disp "APPROXIMATE"

Disp
"VALUES OF ZEROES"

Disp "BETWEEN BOUNDS"

Disp
"THAT YOU SUPPLY."

Disp " [ENTER]"

Pause

**[The following label
lets you re-run the program without re-running the introduction.]**

Lbl
N4

**[Check that the function
is entered. Accept the function, if it is not already stored elsewhere.]**

ClrHome

Menu("IS
F(X) IN Y1?","YES",N1,"NO",N2)

**[Go here if function
needs to be entered; otherwise, go to N1.]**

Lbl
N2

**[Explain required formatting
for entry, and accept entry.]**

ClrHome

Disp
"ENTER F(X)"

Disp "INSIDE QUOTE"

Disp "MARKS."

Disp
" "

Input "Y1 =",Y1

**[Go here if function
is already stored elsewhere.]**

Lbl
N1

**[Clear screen and request
bounds on the zero.]**

ClrHome

Disp
"ENTER THE LOWER"

Disp "(LEFT-HAND)"

Disp
"BOUND, A."

Disp " "

Input "A =",A

ClrHome

Disp
"ENTER THE UPPER"

Disp "(RIGHT-HAND)"

Disp
"BOUND, B."

Disp " "

Input "B =",B

**[Check that "lower
bound" is actually lower than "upper bound". If not,
go to re-entry menu at N5.]**

If
A__>__B

Then

ClrHome

Disp
"THE LOWER BOUND"

Disp "MUST BE LESS"

Disp
"THAN THE UPPER."

Disp " "

Disp " [ENTER]"

Pause

ClrHome

Goto N5

End

**[Find y-values at given
bounds.]**

A STO> X:Y1 STO>
C

B STO> X:Y1 STO> D

**[Check that y-values
have opposite signs. If not, go to re-entry menu at N5.]**

If
(((C<0) and (D<0)) or ((C>0) and (D>0)))

Then

ClrHome

Disp
"THERE IS NO SIGN"

Disp "CHANGE BETWEEN"

Disp
"F(A) AND F(B)."

Disp " "

Disp " [ENTER]"

Pause

ClrHome

Goto N5

Else

ClrHome

Goto N6

End

**[If there is a problem
with the entered bounds, offer to take new bounds, or to quit.]**

Lbl
N5

Menu("TRY NEW BOUNDS?","YES",N1,"NO (QUIT)",N9)

**[Come here once bounds
are okay.]**

Lbl N6

**[Clear screen and see
if either bound is itself a zero.]**

ClrHome

A
STO> X

If Y1=0

Then

Disp "THE ZERO IS AT"

Disp
"A =",A

Pause

Goto N7

End

B STO> X

If Y1=0

Then

Disp "THE ZERO
IS AT"

Disp "B =",B

Pause

Goto N7

End

**[Come here to enter
the desired accuracy.]**

ClrHome

Lbl
N3 Copyright
© Elizabeth Stapel 2005-2011 All Rights Reserved

**[Clear the screen and
request desired accuracy for the zero.]**

ClrHome

Disp
"ENTER DESIRED"

Disp "NUMBER OF"

Disp "DECIMAL
PLACES"

Disp "OF ACCURACY,"

Disp "WITH N __<__
9."

Disp " "

Input "N =",N

**[Check the validity
of the value for "number of decimal places". Allow for re-entering
or quitting.]**

If ((N__<__0)
or (N>9) or (int(N)–N != 0))

Then

ClrHome

Disp "THE
NUMBER OF"

Disp "DECIMAL PLACES"

Disp "MUST
BE SET TO"

Disp "1, 2, 3, 4, 5,"

Disp "6,
7, 8, OR 9."

Disp " [ENTER]"

Pause

ClrHome

Menu("PICK NEW N?","YES",N3,"NO
(QUIT)",N9)

End

**{Store the initial
bounds in variables for computation.]**

A
STO> V

B STO> W

**[Check to see if the
bounds are already sufficiently close together.]**

If
abs(W–V)__<__10^(–N)

Then

(W+Y)/2
STO> X

Goto N8

End

**[Clear the screen and
put up a message to let the user know the program is running.]**

ClrHome

Disp
"WORKING..."

**[Do the following until
either you find the exact zero or you find a sufficient approximation.]**

While
((abs(W–V)>10^(–N)) and (Y1 != 0))

V STO> X:Y1 STO> C

(W+V)/2
STO> X:Y1 STO> D

**[Check the signs on
the y-values to pick which end the midpoint needs to replace.]**

If
(((C<0) and (D<0)) or ((C>0) and (D>0)))

Then

X STO>
V

Else

X STO> W

End

End

**[Come straight here
if computations are unnecessary.]**

Lbl
N8

**[Fix the display at
the chosen number of decimal places. Clear the screen to display
result.]**

Fix N

ClrHome

**[Check to see if the
zero is apparently exact or approximate. Return the appropriate message.]**

If
Y1=0

Then

Disp "THE EXACT ZERO"

Disp "IS AT
X ="

Disp X

Else

Disp "THE ZERO IS AT"

Disp
"ABOUT X ="

Disp X

End

Pause

**[Come here when the
program has successfully found a zero.]**

Lbl
N7

**[Clear screen and offer
options: quitting, or re-running various aspects of the program.]**

ClrHome

Menu("WHAT
NOW?","QUIT",N9,"NEW F(X)",N4,"NEW BOUNDS",N1,"NEW
ACCURACY",N3)

**[Come here when the
program is done, and do some clean-up before quitting.]**

Lbl
N9

**[Return calculator's
number display to "floating point". Clear the screen. End
the program.]**

Float

ClrHome

Stop