10 PRINT "MATRIX ADDITION, SUBTRACTION, SCALAR MULTIPLICATION"
20 PRINT
29 REM - ARRAYS SHOULD BE SET TO DIMENSIONS OF MATRICES
30 DIM A(3,3), B(3,3)
40 PRINT "1=ADDITION"
50 PRINT "2=SUBTRACTION"
60 PRINT "3=SCALAR MULTIPLICATION"
69 REM - SELECT OPERATION BY ENTERING THE NUMBER (1-3) OF THE OPERATION
70 PRINT "WHICH OPERATION";
80 INPUT D
89 REM - TEST FOR ADDITION OR SUBRACTION
90 IF D<>3 THEN 120
100 PRINT "VALUE OF SCALAR";
110 INPUT S
120 PRINT "DIMENSION OF MATRIX (r,c)";
130 INPUT R,C
138 REM - LOOP TO ENTER MATRIX VALUES
139 REM - FOR SUBTRACRION, MATRIX 2 SUBTRACTED FROM MATRIX 1
140 FOR K=1 TO 2
150 IF K=2 THEN 180
160 PRINT "MATRIX 1:"
170 GOTO 190
180 PRINT "MATRIX 2:"
190 FOR J=1 TO R
200 PRINT "ROW";J
210 FOR I=1 TO C
220 PRINT "VALUE COLUMN";I;
230 IF K=2 THEN 260
240 INPUT A(J,I)
250 GOTO 270
260 INPUT B(J,I)
270 NEXT I
280 NEXT J
289 REM - ONLY ONE MATRIX USED FOR SCALAR MULTIPLICATION
290 IF D=3 THEN 310
300 NEXT K
308 REM - STATEMENTS 310 TO 410 PERFORM REQUESTED OPERATION AND
309 REM - PRINT RESULTANT MATRIX
310 FOR J=1 TO R
320 FOR I=1 TO C
330 IF D<>2 THEN 350
340 B(J,I)=-B(J,I)
350 IF D=3 THEN 380
360 PRINT A(J,I)+B(J,I);"   ";
370 GOTO 390
380 PRINT A(J,I)*S;"    ";
390 NEXT I
399 REM - ADVANCE OUTPUT DEVICE TO PRINT NEXT ROW
400 PRINT
410 NEXT J
420 PRINT
429 REM - RESTART OR END PROGRAM?
430 PRINT "MORE DAtA? (1=YES,0=NO)";
440 INPUT D
450 IF D=1 THEN 70
460 END
