! Takoma Park
M.S.
! Int-3
! Contest 2
! Alex Miao
DO
INPUT PROMPT "Input operation: " :
operation$
IF operation$[1:5] = "UNION" OR
operation$[1:9] = "INTERSECT" THEN
INPUT PROMPT "Input cell one: "
: cell$
INPUT PROMPT "Input cell two: "
: cell2$
ELSE
INPUT PROMPT "Input cell: " :
cell$
END IF
IF operation$[1:6] = "DIVIDE" THEN
LET divide1$ = cell$[1:4] &
cell$[1:4]
LET divide2$ = cell$[5:8] &
cell$[5:8]
PRINT divide1$
PRINT divide2$
ELSEIF operation$[1:3] = "ADD"
THEN
LET n = VAL(operation$[4:4])
LET add$ = cell$[1:n] & cell$[1:8-n]
PRINT add$
ELSEIF operation$[1:8] =
"SUBTRACT" THEN
LET n = VAL(operation$[9:9])
LET subtract$ = cell$[n+1:8] &
cell$[9-n:8]
PRINT subtract$
ELSEIF operation$[1:5] = "UNION"
THEN
LET union$ = cell$[5:8] & cell2$[1:4]
PRINT union$
ELSEIF operation$[1:9] =
"INTERSECT" THEN
LET intersect$ = cell$[1:2] &
cell$[7:8] & cell2$[1:2] & cell2$[7:8]
PRINT intersect$
END IF
LOOP
END