Tandy TRS-80 Owner Manual & Programming Manual page 84

Color computer disk system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

APPENDIX
C
740 FOR
X=l
TO N
750 TF*
=
"TEST" +
RIGHT*(STR*(
X
) ,
1
)
760 OPEN "I",#1,TF*
770 FOR
Y»l TO
YEND
780 INPUT #1,GRADE(X,Y)
790 NEXT
Y
800 CLOSE
#1
810 NEXT
X
820 CLS
830 PRINT
a 130*
"
INDIVIDUAL TOTALS
OR CLASS"
840 INPUT
"
TOTALS
(I/O"?
AN*
850
IF
AN*
= "I"
THEN 900
860
IF
AN*
= "C"
THEN
1130
870
'
880
'
This portion processes the
scores
bv the
student.
890
'
900 FOR
Y=l
TO YEND
910 CLS
920 PRINT
a
105>NAME*(Y)
930 PRINT
a
1
37
»
"SCORES:"
940 STUTOT
=
950 FOR
X=l
TO N
960 PRINT TAB(10) GRADE<X*Y>
970 STUTOT
=
STUTOT
+
GRADE(X»Y)
980 NEXT
X
990 AVE(Y)
=
STUTOT
/
N
1000 NUM
=
1010
FOR
X=l
TO N
1020
NUM
=
<AVE(Y)
-
GRADE
<
Y)
>+2
+
NUM
1030 NEXT
X
1040 SD
=
SOR(NUM
/
N)
1050 PRINT
USING
""/.
/.##.##";
"AVERAGE: "?AVE(Y)
1060 PRINT
USING
"V.
'/.
##.##";»
STANDARD
DE
V
I
AT
I
ON
:
"
;
SD
1070 PRINT "PRESS <ENTER> TO SEE
NEXT NAME"
1080 AN* = INKEY*
1090
IF
AN*
=
CHR*<13) THEN 1100
ELSE 1080
1100 NEXT Y
1110 CLS
1120 PRINT
3 105?
"NO
MORE NAMES"
1130
GOTO 1350
1140
'
1150
'
This portion processes the
scores
bv the test
number
1160
'
for the
whole
class.
1170
'
1180 INPUT
"
WHICH TEST NUMBER"
?X
1190 CLS
1200 PRINT
3
4»"DATA FOR TEST
NUMBER
"
;
X
1210 PRINT
»
NAME" STAB
<
25) "SCORE"
1220 TTOT
=
1230 FOR Y=l TO YEND
1240 TTOT
=
TTOT
+
GRADED
Y>
1250 PRINT
TABU)
NAME*(
Y)
;TAB<25)
GRADE(X»Y>
1260 NEXT
Y
1270 AVE
TTOT
/
YEND
1280 NUM
=
1290 FOR Y=l TO
YEND
1300 NUM
=
NUM
+
(AVE
-
GRADE
<
X,Y)
H2
1310 NEXT
Y
1320 SD
=
SQR(NUM
/
(YEND
- 1))
1330 PRINT: PRINT
USING
""/
•/.#•/.•/.##.##"?
"AVERAGE FOR TEST
#"
;X
;
"
:
"
?AVE
1340 PRINT
USING
"7.
"/.
##.##"; "STANDARD DEVIATION: "!SD
1350 PRINT: PRINT
"
PRESS <ENTER>
FOR MORE"
1360 PRINT
"
PROCESSING*
<Q>
TO QUIT"
1370 AN*
=
INKEY*
1380
IF
AN*
=
CHR*(13) THEN 820
1390
IF
AN*
= "Q"
THEN 1400
ELSE
1370
1400 RETURN
1410
'
1420
'
This subroutine terminates
the
program.
1430
'
1440
END
SAMPLE
PROGRAM
#7
CREATE-A-GAME
These
four
programs
will
display 3 scenes
a
house
and two
rooms.
Each
scene
is
stored
on
disk as
a
pro-
gram
file.
10
'
"DISPLAY/BAS"
20
'
30
'
The
ob-Ject of
this program
is to
show you how you
can
40
'
access another program from
Your main program.
It
uses
50
'
a
main program called
"DISPLAY/BAS" and three graphics
6(3
'
p
r o
g
ram
s
c
a
1
1
e
d
"
HOUSE
/
B
AS
"
»
"FOYER/BAS'S and "STAIRS/BAS"
.
70
'
(Natural
1y
thev must
be on
d
i
s k
b
e
f o r
e
y
o u
c
a
n
i-
u n
t
h
i
s
74

Advertisement

Table of Contents
loading

Table of Contents