Radio Shack TRS-80 Model 100 Basic Manual page 111

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

Advertisement

Lines 728 • 748 This FOR/NEXT loop prints the labels along the vertical axis. The
vertical (Y) axis will be used to represent dollar sales ranging from a minimum of 140
to a maximum of 380. For simplicity, labels are started at 150 and incremented in
steps of 50 up to a maximum of 450. The first label (150) is printed in PRINT@
position 240 which is computed as:
280 - 1
*
40.
The second label (200) is printed in PRINT@ position 200 which is computed as:
280 - 2
*
40,
and so On.
Line 2888 This statement creates an infinite loop. The purpose of this is to prevent the
"Ok" and cursor from interfering with the display. This would occur if the program
terminated execution.
Experiment #6 Plot Sales Data
The sales data you saved in Lesson 7 will be plotted on the graph created in the
previous experiment. Enter the following new statements to your program:
750 FOR X
=
1 TO 24 : READ Y
760 PSET (33+X*6, 54-(Y-136)/6425)
770 NEXT X
If you saved the Data statements under the file name SALES .00 as requested in
Lesson 7, merge it with your program with the command:
MERGE "SALES.DO"
If
you did not save file SALES. DO, simply type the data statements so that your
program becomes:
50
CLS
100 LINE (239,54)
-
(33,54)
150 LINE - (33,0)
200 FOR X = 33 TO 239 STEP 24
300 PSET (X ,53)
:
NEXT X
500 FOR Y
=
51 TO
o
STEP -8
800 PSET ( 34 , Y)
:
NEXT Y
700 FOR X
=
o
TO 28 STEP 4
710 PRINT@ 284+X,X;
:
NEXT X
720 FOR Y
=
1 TO 7
730 PRINT@ 280-Y*40, 100+Y*50
740 NEXT Y
750 FOR X = 1 TO 24
.
READ Y
.
780 PSET (33+X*8, 54-(Y-138)/8.25)
770 NEXT X
900 DATA 180, 175, 140, 230
910 DATA 155, 215, 155, 225
920 DATA 215, 285, 220, 325
830 DATA 225, 270, 265, 280
840 DATA 275, 350, 255, 345
105

Advertisement

Table of Contents
loading

Table of Contents