File: file.cob

package info (click to toggle)
gtksourceview4 4.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,840 kB
  • sloc: ansic: 49,715; sh: 4,917; xml: 1,302; makefile: 1,010; python: 230; perl: 52; yacc: 45; cobol: 20; objc: 19; sed: 16; fortran: 14; cpp: 8; ml: 3
file content (25 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
       IDENTIFICATION DIVISION.
       PROGRAM-ID. Age.
       AUTHOR. Fernando Brito.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  Age               PIC 99   VALUE ZEROS.
       01  Had_Birthday      PIC X    VALUE SPACES.
       01  Current_Year      PIC 9999 VALUE 2010.
       01  Result            PIC 9999 VALUE ZEROS.

       PROCEDURE DIVISION.
          DISPLAY "==> How old are you?".
          ACCEPT Age
          DISPLAY "==> Had you already had birthday this year (y or n)?".
          ACCEPT Had_Birthday

          SUBTRACT Current_Year FROM Age GIVING Result

          IF Had_Birthday = "n" THEN
            SUBTRACT 1 FROM Result GIVING Result
          END-IF

          DISPLAY "Let me guess... "" You were born in ", Result
          STOP RUN.