IDENTIFICATION DIVISION. PROGRAM-ID. PROGVENDA.
******************************************************************
*AREA DE COMENTARIOS - REMARKS
* Author: RODRIGO F. BARRETO
* OBJETIVO: RECEBER A VENDA DE MOSTRAR NO CONSOLE
* CALCULE E IMPRIMA A MEDIA ARITMETICA DESTAS VENDAS
* FORMATADA EM TELA COM CIFRAO, PONTOS E CASAS DECIMAIS.
* DATA: 14/05/2021
*******************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 WRK-VENDA1 PIC 9(5)V99 VALUE ZEROS.
77 WRK-VENDA2 PIC 9(5)V99 VALUE ZEROS.
77 WRK-MEDIA PIC $ZZ.ZZ9,99 VALUE ZEROS.
PROCEDURE DIVISION.
DISPLAY 'DIGITE O VALOR DA PRIMEIRA VENDA:'
ACCEPT WRK-VENDA1 FROM CONSOLE.
DISPLAY 'DIGITE O VALOR DA SEGUNDA VENDA:'
ACCEPT WRK-VENDA2 FROM CONSOLE.
DISPLAY '=============================='.
DISPLAY 'VENDA1 ..... ' WRK-VENDA1.
DISPLAY 'VENDA2 ..... ' WRK-VENDA2.
DISPLAY '=============================='.
********************COMPUTE*********
COMPUTE WRK-MEDIA = (WRK-VENDA1 + WRK-VENDA2) /2.
DISPLAY 'MEDIA .2..... ' WRK-MEDIA.
STOP RUN.