An example program that implements a primative calculator. The calculator only does additions and multiplications.
$ SET SOURCEFORMAT"FREE"
IDENTIFICATION DIVISION.
PROGRAM-ID. Iteration-If.
AUTHOR. Michael Coughlan.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Num1 PIC 9 VALUE ZEROS.
01 Num2 PIC 9 VALUE ZEROS.
01 Result PIC 99 VALUE ZEROS.
01 Operator PIC X VALUE SPACE.
PROCEDURE DIVISION.
Calculator.
PERFORM 3 TIMES
DISPLAY "Enter First Number : " WITH NO ADVANCING
ACCEPT Num1
DISPLAY "Enter Second Number : " WITH NO ADVANCING
ACCEPT Num2
DISPLAY "Enter operator (+ or *) : " WITH NO ADVANCING
ACCEPT Operator
IF Operator = "+" THEN
ADD Num1, Num2 GIVING Result
END-IF
IF Operator = "*" THEN
MULTIPLY Num1 BY Num2 GIVING Result
END-IF
DISPLAY "Result is = ", Result
END-PERFORM.
STOP RUN.
Sample Proposal Letter
-
September 12, 2013 Mr. Daniel CabangonManagerVelasco VillageParanaque City
Dear Mr. Cabangon: Good day! We are MJ Construction. Our company offers
differen...
2 comments:
Thanks for the valuable tips!
Proposal Sample
Outsourcing to Eastern Europe has a range of advantages due to its attractive cost-to-quality ratio. I would recommend checking out this article to learn more about the software development in Eastern Europe.
Post a Comment