0
respostas

Atividade 8 - Faça o que eu fiz na aula (Respondido)


           IDENTIFICATION DIVISION.
           PROGRAM-ID. PROGAUMENTOSALARIO.
      ******************************************************************
      *AREA DE COMENTARIOS - REMARKS
      * Author: RODRIGO BARRETO
      * OBJETIVO: APLICAR O AUMENTO DE SALARIAL COM BASE NO 
      * ********  TEMPO DE EMPRESA
      * UTILIZAR MOSTRAR O AUMENTO SALARIAL POR TEMPO DE EMPRESA
      * DATA: 18/05/2021
      *******************

           ENVIRONMENT DIVISION.

           CONFIGURATION SECTION.
            SPECIAL-NAMES.
                 DECIMAL-POINT IS COMMA.
           DATA DIVISION.

           WORKING-STORAGE SECTION.
      ******************  VARIAVEIS  ***************************  
           77 WRK-NOME          PIC X(20) VALUE SPACES. 
           77 WRK-TEMPO-EMPRESA PIC 9(04) VALUE ZEROS.   
           77 WRK-SALARIO       PIC 9(04)V99 VALUE ZEROS. 
           77 WRK-SALARIO-ED    PIC $ZZZZ,99 VALUE ZEROS.
           PROCEDURE DIVISION.

      ******************      CONDICOES      *************************** 
      *           AUMENTO SALARIAL CONFORME ABAIXO:
      *           0 a 1 ano    0%
      *           de 2 a 05 anos    5%
      *           de 06 a 15 anos    10%
      *           a partir de 16 anos    15%
      ***************************************************************

             MOVE WRK-SALARIO TO WRK-SALARIO-ED.

               DISPLAY  'NOME ..               ' 
               ACCEPT  WRK-SALARIO              FROM CONSOLE.

               DISPLAY  'TEMPO DE EMPRESA ..   ' 
               ACCEPT  WRK-TEMPO-EMPRESA        FROM CONSOLE.

               DISPLAY  'SALARIO ..            ' 
               ACCEPT   WRK-SALARIO             FROM CONSOLE.

      ******************* LOGICA DAS CONSICOES *************************


               EVALUATE WRK-TEMPO-EMPRESA
                 WHEN 0 THRU 1
                 DISPLAY ' SEM AUMENTO DEVIDO AO TEMPO DE EMPRESA'

                 WHEN 2 THRU 5
                  COMPUTE WRK-SALARIO-ED = (WRK-SALARIO * 0,05) + 
                   WRK-SALARIO

                  WHEN 6 THRU 15
                   COMPUTE WRK-SALARIO-ED = (WRK-SALARIO * 0,10) + 
                    WRK-SALARIO

                  WHEN OTHER
                  COMPUTE WRK-SALARIO-ED = (WRK-SALARIO  * 0,15) + 
                   WRK-SALARIO

                 END-EVALUATE.
      *********************** CONSOLE ********************************

                 DISPLAY '========================'
                 DISPLAY 'O AUMENTO DE SALARIAL E '
                 WRK-SALARIO-ED.

                   STOP RUN.