changeset 474:dd1e1db4723d

Added a cobol example code file. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@713 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Thu, 29 May 2008 08:39:35 +0000
parents 4b1ae20f1e06
children 9ae1f74e952a
files indenters/example.cbl
diffstat 1 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/indenters/example.cbl	Thu May 29 08:39:35 2008 +0000
@@ -0,0 +1,30 @@
+      $ 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.
\ No newline at end of file