SHARE
TWEET

EDAD COBOL

a guest Dec 12th, 2018 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       *cobc -x DRIVE.cbl -o DRIVE.exe
  2.      
  3.        IDENTIFICATION DIVISION.
  4.        PROGRAM-ID. FICHEROS.
  5.        AUTHOR. Valentino Zaffrani.
  6.        INSTALLATION. WindowsXP.
  7.        DATE-WRITTEN. 12-12-18.
  8.        DATE-COMPILED. 12-12-18.
  9.  
  10.        ENVIRONMENT DIVISION.
  11.  
  12.        CONFIGURATION SECTION.
  13.        SOURCE-COMPUTER. WindowsXP.
  14.        OBJECT-COMPUTER. WindowsXP.
  15.        SPECIAL-NAMES.
  16.  
  17.        INPUT-OUTPUT SECTION.
  18.  
  19.        DATA DIVISION.
  20.  
  21.        WORKING-STORAGE SECTION.
  22.        01  WORK-AREA.
  23.            05  AGE      PIC 99.
  24.            05  AGEMIN   PIC 99  VALUE '18'.
  25.            05  AGERES   PIC 9.
  26.            05  DAYSRES  PIC 9(4).
  27.  
  28.        PROCEDURE DIVISION.
  29.          DISPLAY 'Ingresa tu edad: '.
  30.          ACCEPT AGE.
  31.  
  32.          IF AGE < 12
  33.            DISPLAY 'Te falta mucho aun! Lo siento ;('.
  34.  
  35.          IF AGE >= AGEMIN
  36.            DISPLAY 'Bien!, cumples la edad minima para conducir! (:'.
  37.  
  38.          SUBTRACT AGE FROM AGEMIN GIVING AGERES.
  39.          MULTIPLY AGERES BY 365 GIVING DAYSRES.
  40.  
  41.          IF AGE >= 12
  42.            IF AGE < AGEMIN
  43.              DISPLAY 'Te faltan 'DAYSRES' dias para poder conducir! :)'.
  44.  
  45.          STOP 'Presiona ENTER para salir'.
  46.        STOP RUN.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top