Operation Manual

14-10 Applications
8214APPS.DOC TI-82, Chapter 14, English Bob Fedorisko Revised: 02/09/01 9:27 AM Printed:
02/09/01 12:43 PM Page 10 of 20
Program: Guess the Coefficients
This program graphs the function A sin BX with random integer coefficients
between 1 and 10. You then try to guess the coefficients and graph your guess as
C sin DX. The program continues until your guess is correct.
Program
PROGRAM:GUESS
:PlotsOff :Func
:FnOff :Radian
:ClrHome
:"Asin BX"
!
Y
1
:"Csin DX"
!
Y
2
Define equations
:iPart 10rand+1
!
A
:iPart 10rand+1
!
B
:0
!
C:0
!
D
Initialize coefficients
:
-
2
p
!
Xmin
:2
p
!
Xmax
:
2
!
Xscl
:
-
10
!
Ymin
:10
!
Ymax
:1
!
Yscl
Set viewing
WINDOW
:DispGraph
:Lbl Z
Display graph
:Prompt C,D
Prompt for guess
:If C=A
:Text(1,1,"C IS
OK")
:If C
ƒ
A
:Text(1,1,"C IS
WRONG")
:If D=B
:Text(1,50,"D IS
OK")
:If D
ƒ
B
:Text(1,50,"D IS
WRONG")
:DispGraph
:Pause
Display results
:If C=A and D=B
:Stop
:Goto Z
Quit if guesses are correct