ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
619 B

  1. 10 PRINT "GEOMETRIC MEAN AND DEVIATION"
  2. 20 PRINT
  3. 30 PRINT "(TO END PROGRAM ENTER 0 OBSEVATIONS)"
  4. 40 PRINT "NUMBER OF OBSERVATIONS";
  5. 50 INPUT N
  6. 59 REM - TEST FOR END OF PROGRAM
  7. 60 IF N=0 THEN 200
  8. 69 REM - COMPUTE WHICH ROOT TO USE
  9. 70 P=1/N
  10. 80 M=1
  11. 90 FOR I=1 TO N
  12. 100 PRINT "ITEM";I;
  13. 110 INPUT D
  14. 119 REM - ITERATIVELY COMPUTE MEAN
  15. 120 M=M*D[P
  16. 129 REM - ACCUMULATE INTERMEDIATE TERM FOR DEVIATION
  17. 130 Q=Q+LOG(D)[2
  18. 140 NEXT I
  19. 149 REM - COMPUTE DEVIATION
  20. 150 R=EXP(SQR(Q/(N-1)-(N/(N-1)*(LOG(M))[2)))
  21. 160 PRINT "GEOMETRIC MEAN =";M
  22. 170 PRINT "GEOMETRIC DEVIATION =";R
  23. 180 PRINT
  24. 189 REM - RESTART PROGRAM
  25. 190 GOTO 40
  26. 200 END