\START\ \COMMENT=Program file dated 08/06/95, 22:05 \NAME=Riem \FILE=RIEM.85P ClLCD Disp " Riemann Integration" Disp "" Disp "Do you want graphics" Menu(1,"Yes",YES,5,"No",NO) Lbl YES 1\->\G Disp "Graphics On" Goto NINT Lbl NO 0\->\G Disp "No Graphics" Lbl NINT Prompt xMin Prompt xMax Lbl Opts ClLCD Disp "Number of intervals:" Prompt N (xMax-xMin)/N\->\D Disp "Left or Right hand" Menu(1,"Left",LEFT,5,"Right",RIGHT) Lbl RIGHT D\->\LR Disp "Right" Goto ChkG Lbl LEFT 0\->\LR Disp "Left" Lbl ChkG If G==0 Goto NoG ClDrw If G==1 Then FnOff FnOn 1 fMax(y1,x,xMin,xMax)\->\V evalF(y1,x,V)\->\yMax fMin(y1,x,xMin,xMax)\->\V evalF(y1,x,V)\->\yMin (yMax-yMin)/62\->\H yMax+H\->\yMax yMin-H\->\yMin If yMin>0 0\->\yMin If yMax<0 0\->\yMax DrawF y1 StPic functgr 2\->\G FnOff End Lbl NoG 0\->\RSum xMin\->\X If G==2 RcPic functgr For(I,1,N,1) X+LR\->\x y1\->\Y If G==0 Goto AddOn Line(X,0,X,Y) Line(X,Y,X+D,Y) Line(X+D,0,X+D,Y) Lbl AddOn RSum+Y\->\RSum X+D\->\X End If G\<>\0 Pause RSum*D\->\RSum Disp "Riemann sum=",RSum Menu(1,"Again",Opts,5,"Quit",Quit) Lbl Quit \STOP\