An example program that implements a primative calculator. The calculator only does additions and multiplications.
$ SET SOURCEFORMAT"FREE"
AUTHOR. Michael Coughlan.
01 Num1 PIC 9 VALUE ZEROS.
01 Num2 PIC 9 VALUE ZEROS.
01 Result PIC 99 VALUE ZEROS.
01 Operator PIC X VALUE SPACE.
PERFORM 3 TIMES
DISPLAY "Enter First Number : " WITH NO ADVANCING
DISPLAY "Enter Second Number : " WITH NO ADVANCING
DISPLAY "Enter operator (+ or *) : " WITH NO ADVANCING
IF Operator = "+" THEN
ADD Num1, Num2 GIVING Result
IF Operator = "*" THEN
MULTIPLY Num1 BY Num2 GIVING Result
DISPLAY "Result is = ", Result
Honor Assembly Letter - October 19, 2000 Mrs. Sara May Sales Townsite, Limay, Bataan Dear Mrs. Sales, Good day. Please be informed that we will have our student quarterly honor as...