Application #3 Descriptive Statistics - Radio Shack TRS-80 Model 100 Basic Manual

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

Application #3 Descriptive Statistics
This application program computes a variety of common statistics and prints a
histogram.
Insert the cassette containing the Descriptive Statistics application program in your
cassette recorder. Rewind the cassette if necessary. If you have loaded the Memory
Master application program and have not changed the position of the tape, you can
speed up the loading of the descriptive statistics program by not rewindirig the
cassette.
Clear memory with the NEW command and then load the Descriptive Statistics
program by pressing PLAY on the recorder and entering the command:
CLOAD "STAT"
List and compare it to the listing below to verify that it loaded correctly.
1121121 DIM A( 1121121) ,F( 1121l
105 CLS
11121 INPUT"RAM
or
CASSETTE FILE (R
or
Cl";r$
12121 IF T$< )"R" AND T$< )"C" GOTO 11215
13121 INPUT"FILE NAME";N$
14121 IF T$="R" THEN N$="RAM:"+N$
15121 IF T$="C" THEN N$="CAS:"+N$
16121 OPEN N$ FOR INPUT AS 1
165 N=1
17121 INPUT #l,A(Nl
18121 IF EOF(1l GOTO 21121
18121 N=N+l
2121121 GOT
a
17121
21121 CLOSE
22121 CLS
23121 INPUT"OUTPUT DATA (Y
or
Nl";T$
24121 IF T$="N" GOTO 35121
25121 IF T$<>"Y" GOTO 22121
26121 PRINT"OUTPUT ON LCD, LINE PRINTER OR BOTH"
27121 INPUT"(L,P
or
Bl";T$
28121 IF T$="L" GOTO 31121
28121 IF T$="P" GOTO 34121
3121121 IF T$<>"B" GOTO 26121
31121 CLS:FOR 1=1 TO N
32121 PRINT 'A( I 1:NEXT I
33121 IF T$="L" GOTO 35121
34121 FOR 1=1 TO N
345 LPRINTA(I):NEXT I:LPRINT" "
35121 PRINT:PRINT"SORTING, PLEASE WAIT"
36121 FOR 1=1 TO N-1
37121 FOR J=1 TO N-I
195

Advertisement

Table of Contents
loading

Table of Contents