home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / Advanced_Math_Samples / trapezold < prev    next >
Encoding:
Text File  |  2005-03-02  |  516 b   |  16 lines

  1. 10    CLEAR SCREEN
  2. 20    LOADSUB ALL FROM "..\mathlib\Mathlib.hts"
  3. 30    REAL A(8)  ! holds nine values
  4. 40! Build array where x goes from 1 to 3 step .25
  5. 50    INTEGER Loop
  6. 60    FOR Loop=0 TO 8
  7. 70      A(Loop)=(1+.25*(Loop))^4 ! put the x^4 value in a(Loop)
  8. 80    NEXT Loop
  9. 90 ! Display
  10. 100   S=.25
  11. 110   PRINT "Integration using the Trapezoid Rule."
  12. 120   PRINT "Function (x^4) to intigrate from 1 to 3"
  13. 130   PRINT "The aproximated answer is";FNTrapezoid(A(*),S)
  14. 140   DELSUB FNAi TO END
  15. 150   END
  16.