# Computing

## Understanding—BASIC Programming for Remedial Students

Your feedback is important to us!

After viewing our curriculum units, please take a few minutes to help us understand how the units, which were created by public school teachers, may be useful to others.

*
SUBTRACTION PROGRAMS
*

### program 1

10 REM FIND THE ANSWER TO TEN SUBTRACTION PROBLEMS20 LET I=1

30 READ A,B

40 LET C = A-B

50 PRINT A,B,C

60 LET I = I + 1

70 IF I $lt 11 THEN 30

80 DATA 10,6,15,9,12,7,14,5,18,9

90 DATA 11,3,6,2,13,7,6,3,9,1

100 END

Results:

10 | 6 | 4 |

### Explanation—program 1

Line 80 “DATA” assigns values to the variables.

- Line 20 This begins the counting for the ten problems.
- Line 30 “READ” will read the numbers in the “DATA” by assigning values to the variables.
- Line 60 Tells the computer to do the next problem.
- Line 70 “IF” tells the computer that if under eleven problems have been done then continue. Once ten problems are complete the program will end.

90

### program 2

10 REM SUBTRACT TO FIND THE DIFFERENCE20 READ A,B

30 LET C = A - B

40 PRINT A,B

50 PRINT “WHAT IS THE DIFFERENCE?”

60 INPUT C1

61 PRINT C1

70 IF C1 = C THEN 90

80 PRINT “SORRY, TRY THE NEXT ONE”

84 PRINT

85 GO TO 20

90 PRINT “VERY GOOD”

99 PRINT

100 GO TO 20

110 DATA 16,9,12,4,10,5,8,6,15,7

120 END

Results:

16 | 9 |

7

VERY GOOD

12 | 4 |

9

SORRY, TRY THE NEXT ONE

Explanation—program 2

Line 70 If the answer that was typed into the terminal was correct then “VERY GOOD” would be printed. If the answer was incorrect “SORRY, TRY THE NEXT ONE” would be printed. Only one try is given to find the answer and then the next problem appears.

Line 84 “PRINT” with nothing after it will allow for a blank space in the results. I used it so the results would be easier to read.