EasyManua.ls Logo

Tandy TRS-80 - Page 83

Tandy TRS-80
104 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
.APPENDIX
C
750
LSET
TNAME*
=
NAME*
760
LSET TAREA*
=
AREA*
770
LSET TPHONE*
=
PHONE*
780
J=J+1
790
PUT
#2,
J
800 NEXT
I
810
CLOSE
820 KILL
"NAMES/NOS"
830 RENAME
"TEMP/FIL"
TO "NAMES/NOS"
840
RETURN
850
END
SAMPLE
PROGRAM
#6
GRADING
TESTS
This
program is ideal
for
teachers. It
creates
several
disk files of
students and
their
test score. You
can then
immediately
find
averages and
standard
deviation
for
the entire class
or for
each individual
student.
10
'
Test
pros
ram
20
'
30
'
The
object
of
this,
program
is to
input
several
40
'
files
a
names
file
and
several
test
files.
50
'
The
files
can then
he
accessed
as
desired
and the
60
'
test
scores
processed
to
find
averages
and
standard
70
'
deviations.
The
files
are
all
sequential
access
files.
80
'
90
'
100
'
Main
module
of
program
110
'
120 DIM
NAME*
<
30),
GRADE
<6, 30)
130
CLS
140 PRINT
a
107,"
SELECT
IONS"
160 PRINT
a 164,
M
1)
CREATE
A
'NAMES'
FILE"
170 PRINT
a 196,
H
2)
ADD
A NEW
TEST
FILE"
180 PRINT
a
228,
"3)
PROCESS
SCORES"
190
PRINT
a
260,
H
4)
END"
210 PRINT
a 331,
"1,2,3
OR
4"
220
AN*=INKEY*
230
IF
AN*=""
THEN
220
240 ON
VAL<AN*)
GOSUB
290,430,
640,
1430
250
GOTO
130
260
'
270
'
This
subroutine
builds
a
"NAMES"
file.
280
'
290 OPEN
"0",#1,"NAME/FIL"
300
CLS
310 PRINT
a 96,
"ENTER
NAME
OF
STUDENT
:
320
LINE INPUT
NAME*
330 WRITE
#1,NAME*
340 PRINT
3
196,
"(PRESS
<ENTER>
TO
ENTER"
:PRINT
3
228,
"ANOTHER
NAME,
PRESS
<0>":
PRINT
a
260,
"TO
QUIT)"
350
AN*=INKEY*
360
IF
AN*=""
THEN
350
370 IF
AN*O"0"
THEN
300
380 CLOSE
#1
390
RETURN
400
'
410
'
This
subroutine
builds
test
files.
420
'
430
CLS
440
PRINT
3 64
450 INPUT
"NUMBER
OF
NEW
TEST
FILE";TF*
460 IF
TF*
=
"
THEN
450
470 TF*
=
"TEST"
+
TF*
480 OPEN
"I",#1,"NAME/FIL"
490
OPEN
"0",#2,TF*
500
IF
EOF(l)
THEN
560
510
INPUT
#1,NAME*
520 PRINT
"NAME:"?NAME*
530 INPUT
"SCORE"
; SCORE
540
WRITE
#2,
SCORE
550 GOTO
500
560
CLOSE
#1,#2
570
RETURN
580
'
590
'
This
subroutine
inputs
the
"NAMES"
file
and
the
600
'
desired
test
files
and then
processes
them
either
610
'
on
a class
basis
or
an
individual
basis,
and
620
'
then
prints
out
the
results.
630
»
640 OPEN
"I",#1,"NAME/FIL"
650 IF
EOF(l)
=
-1
THEN
690
660 Y
=
Y
+
1
670 INPUT
#1,NAME*(Y)
680
GOTO
650
690
YEND
=
Y
700
CLOSE
#1
710
CLS
720
PRINT
3
96
730 INPUT
"
HOW
MANY
TESTS
ARE
THERE"
5N
73

Related product manuals