12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10 the computer asks for a number. In line 20, if thenumber is too low, it says so and goes back to line 10 torepeat its request.'At line 30, if the number received at line 10 is toolarge, it says so and goes back to line 10 for a betterchoice.The result is only printed at line 40 when a satisfactorynumber has been keyed in back at line 10.You can set your own limits by changing the 10 inline 20 and the 100 in line 30.Program Listing10 PRINT •GIVE ME A NUMBER"15 INPUT A20 IF AlOO THEN PRINT ·Too HIGHn35 IF AlOO THEN GOTO 1040 PRINT A;• IS OKAY•50 PRINT60 PRINT70 GOTO 1047 Standard DeviationHere's a way to determine mean and standard deviation.In this particular program, you exit the entry cycle byentering the large number 999999999 (nine 9's) so youcan't use 999999999 as one of your data points.This is a great opportunity to experiment with standarddeviation computations. Try a series of data pointssuch as 3, 5, 3, 7, and 4. They should result in a total of 22;mean of 4.4; variance of 2.24; and standard deviation of1.496663.Program Listing10 GOTO 16020 PRINT •nATA POINT: •;25 INPUT X66

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!