Radio Shack TRS-80 Model 100 Basic Manual page 167

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

Advertisement

8121
PRINT @ll, "RADID SHACK";
7121
PRINT @28, DATE$;
8121. LINE (2llt15)-(21121,31> ,12I,BF
8121
PR I NT @8ll, "PAY TD:
"; N$ ( I ) ;
1121121 PRINT @12ll, R(I)
*
H(I);
11121 PRINT@1ll8,"DOLLARS"j
12121 FOR K=1 TO 1000 : NEXT K
130 NEXT I : END
1110 PRINT @2lll2l, ER$;
150 PRINT @28121, ER$;
180 PRINT @2lll2l, "NAME" j
170 INPUT N$
180 FOR J=1 TO 8:IF N$<>N$(J) GOTO 210
180 PRINT@280 ,"RATE"R(J)"
HOURS"H(J);
21210 RETURN
210 NEXT J : RETURN
300 DATA SUE SMITH,7.5,lll2l,TIM LEE,8,35
310 DATA RON REED,8,ll0,ANN JONES,8.5,38
320 DATA JAN ELY,7,lll2l,SAM BAKER,15.5,38
Check the program carefully against the listing and then execute it.
You will see a "check" drawn on the display similar to the one illustrated below:
RADIO SHACK
PAY TO:
SUE SMITH
3121121
1121/1121/83
DOLLARS
If you let the program run for a few minutes, you will see checks display in
succession for each of the employees listed in the data statements. As you can see, it
takes quite a bit of time to display each check. This was intended to simulate the time
it would take to print a check using a printer instead of the LCD display.
Execute the program again. This time however, press Cf1) before the second check is
displayed. You should see:
RADIO SHACK
PAY TO:
SUE SMITH
300
1121/10/83
DOLLARS
NAME?
Notice the NAME? prompt just below the check. If you enter the name SAM
BAKER, you should see his pay rate and hours worked this week appear on the
bottom line of the display as:
RATE 15.5
HOURS 38
As soon as the rate and hours appear, the checks continue printing. You can interrupt
the check printing at any time to find out the pay rate and hours worked of any
employee listed in the data statements.
161

Advertisement

Table of Contents
loading

Table of Contents