# APPLE ][ RPN SIMPLE CALCULATOR

2 posts / 0 new
Offline
Last seen: 5 months 1 week ago
Joined: Nov 21 2010 - 15:30
Posts: 249
APPLE ][ RPN SIMPLE CALCULATOR

I'm partecipating to the Retrochallenge 2016/10 and i would like to go farther, so after i have bought an HP 35s calculator i was inspired by RPN reverse polish notation of this calculator, so i started programming and in less or more 1 hour i made this:

5 SPEED = 150
6 INVERSE
10 PRINT "APPLE ][ RPN SIMPLE CALCULATOR BY MATTEO TREVISAN"
20 HOME
40 PRINT "NUMBER ONE":INPUT A
50 PRINT"NUMBER TWO":INPUT B
60 PRINT "DO YOU WANT TO ADD,SUBTRACT,DIVIDE, MULTIPLY": INPUT A\$
70 IF A\$ = "ADD" THEN GOTO 110
80 IF A\$ = "SUBTRACT" THEN GOTO 170
90 IF A\$ = "DIVIDE" THEN GOTO 230
100 IF A\$ = "MULTIPLY" THEN GOTO 280
110 C = A+B
160 PRINT "THE ADDITION IS "; C
161 FOR K = 1 TO 5000
162 NEXT K
165 GOTO 10
170 D = A-B
180 PRINT "THE SUBTRACTION IS "; D
190 FOR K = 1 TO 5000
200 NEXT K
210 GOTO 10
230 E = A/B
240 PRINT "THE DIVISION IS "; E
250 FOR K = 1 TO 5000
260 NEXT K
270 GOTO 10
280 F = A*B
290 PRINT "THE MULTIPLY IS "; F
300 FOR K = 1 TO 5000
310 NEXT K
320 GOTO 10
330 END

If you want to download the .dsk version image disk for applewin or linapple and Apple ][ go here:

Apple ][ SIMPLE RPN CALCULATOR by MATTEO TREVISAN

Offline
Last seen: 5 months 1 week ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Re: APPLE ][ RPN SIMPLE CALCULATOR

I go farther...

i have fixed a bug and added exponentiation and percentage formula.

here the code:

5 SPEED = 150
6 INVERSE
10 PRINT "APPLE ][ RPN SIMPLE CALCULATOR BY MATTEO TREVISAN"
20 HOME
40 PRINT "NUMBER ONE":INPUT A
50 PRINT"NUMBER TWO":INPUT B
60 PRINT "DO YOU WANT TO ADD,SUBTRACT,DIVIDE, MULTIPLY, PERCENTAGE, EXPONENTIATION": INPUT A\$
70 IF A\$ = "ADD" THEN GOTO 110
80 IF A\$ = "SUBTRACT" THEN GOTO 170
90 IF A\$ = "DIVIDE" THEN GOTO 230
100 IF A\$ = "MULTIPLY" THEN GOTO 280
101 IF A\$="PERCENTAGE" THEN GOTO 330
102 IF A\$="EXPONENTIATION" THEN GOTO 380
103 IF A\$ <> "ADD" THEN GOTO 10
104 IF A\$ <> "SUBTRACT" THEN GOTO 10
105 IF A\$ <> "DIVIDE" THEN GOTO 10
106 IF A\$ <> "MULTIPLY" THEN GOTO 10
107 IF A\$ <> "PERCENTAGE" THEN GOTO 10
108 IF A\$ <> "EXPONENTIATION" THEN GOTO 10
110 C = A+B
160 PRINT "THE ADDITION IS "; C
161 FOR K = 1 TO 5000
162 NEXT K
165 GOTO 10
170 D = A-B
180 PRINT "THE SUBTRACTION IS "; D
190 FOR K = 1 TO 5000
200 NEXT K
210 GOTO 10
230 E = A/B
240 PRINT "THE DIVISION IS "; E
250 FOR K = 1 TO 5000
260 NEXT K
270 GOTO 10
280 F = A*B
290 PRINT "THE MULTIPLY IS "; F
300 FOR K = 1 TO 5000
310 NEXT K
320 GOTO 10
330 F = (A/100)*B
340 PRINT "THE PERCENTAGE IS "; F
350 FOR K = 1 TO 5000
360 NEXT K
370 GOTO 10
380 H = A^B
430 PRINT "THE EXPONENTIATION IS "; H
440 FOR K = 1 TO 5000
450 NEXT K
460 GOTO 10
470 END