Guess the Coefficients:
This program generates a function in the form A*SIN(BX) with random integer coefficients
between 1 and 10. Seven data points from the function are plotted. You are prompted to guess
tbhe coefficients, which are plotted as C*SIN(DX). The program continues until your guess is
correct. It can be modified for other functions.
PROGRAM:GUESS
:FUNC:RADIAN
:\(-)\31(\pi\/12)->XMIN
:31(\pi\/12)->XMAX
:\pi\/2->XSCL
:\(-)\10->YMIN
:10->YMAX
:1->YSCL
:"A*SIN (BX)"->Y1
:RANDINT(1,10)->A
:RANDINT(1,10)->B
:PLOTSOFF: FNOFF
:DISPGRAPH
:SEQ(XMIN+I*\delta X\,I,0,62,9)->L1
:Y1(L1)->L2
:PLOT1(\scatter plot\,L1,L2,\box icon\)
:DISPGRAPH
:PAUSE
:"C*SIN (DX)"->Y2
:LBL W
:CLRHOME
:DISP "C*SIN (DX)"
:INPUT "C=",C
:INPUT "D=",D
:DISPGRAPH
:PAUSE
:IF C=A
:DISP "C IS OK'
:IF C>A
:DISP "C IS TOO HIGH"
:IF CB
:DISP "D IS TOO HIGH"
:IF D