IDENTIFICATION DIVISION.
       PROGRAM-ID. IF_ELSE.
##########################################
####### ÁREA DE COMENTÁRIOS - REMARKS
####### AUTHOR: MISAEL(BB) MISAELBB
####### OBJETIVO: RECEBER 2(DUAS) NOTAS, MÉDIA, IMPRIMIR
####### UTILIZAR COMANDO IF/IF_ELSE/ENDIF
####### DATA: 22/01/2024
##########################################
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
               SPECIAL-NAMES.
            DECIMAL-POINT IS COMMA.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       77 WRK-NOTA1    PIC 9(02)   VALUE ZEROS.
       77 WRK-NOTA2    PIC 9(02)   VALUE ZEROS.
       77 WRK-MEDIA    PIC 9(02)V9 VALUE ZEROS.
       77 WRK-MEDIA-ED PIC 9V9     VALUE ZEROS.
       PROCEDURE DIVISION.
           ACCEPT WRK-NOTA1 FROM CONSOLE.
           ACCEPT WRK-NOTA2 FROM CONSOLE.
            COMPUTE WRK-MEDIA = (WRK-NOTA1 + WRK-NOTA2) / 2.
            MOVE WRK-MEDIA TO WRK-MEDIA-ED.
            DISPLAY 'MEDIA: ' WRK-MEDIA-ED.
              EVALUATE WRK-MEDIA-ED
                WHEN 6 THRU 10
                    DISPLAY 'APROVADO'
                WHEN 4 THRU 6
                    DISPLAY 'EM RECUPERACAO'
                WHEN OTHER
                    DISPLAY 'REPROVADO'
              END-EVALUATE.
       STOP RUN. 
by

Cobol Online Compiler

Write, Run & Share Cobol code online using OneCompiler's Cobol online compiler for free. It's one of the robust, feature-rich online compilers for Cobol language. Getting started with the OneCompiler's Cobol editor is easy and fast. The editor shows sample boilerplate code when you choose language as Cobol and start coding.