-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathComparando valores
50 lines (46 loc) · 1.97 KB
/
Comparando valores
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
IDENTIFICATION DIVISION.
PROGRAM-ID. PRGCOB08.
******************************************************
*** AREA DE COMENTARIOS - REMARKS
*** OBJETIVO DO PROGRAMA = COMANDO EVALUATE
*** AUTOR: IVAN
*** DATA : XX/XX/20XX
******************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 WRK-PRODUTO PIC X(20) VALUE SPACES.
77 WRK-VALOR PIC 9(06)V99 VALUE ZEROS.
77 WRK-UF PIC X(02) VALUE 'SP'.
77 WRK-FRETE PIC 9(04)V99 VALUE ZEROS.
PROCEDURE DIVISION.
DISPLAY 'PRODUTO COMPRADO..... : '.
ACCEPT WRK-PRODUTO.
DISPLAY 'VALOR DO PRODUTO...... : '.
ACCEPT WRK-VALOR.
DISPLAY 'ESTADO DE ENTREGA (SP/RJ/MG).. : '.
ACCEPT WRK-UF.
DISPLAY '--------- SAIDA DE DADOS --------------------'.
DISPLAY 'PRODUTO... : ' WRK-PRODUTO.
DISPLAY 'VALOR..... : ' WRK-VALOR.
DISPLAY 'ESTADO.... : ' WRK-UF.
*********** OPERACAO CALCULO FRETE - COMANDO EVALUATE ***********
EVALUATE WRK-UF
WHEN 'SP'
COMPUTE WRK-FRETE = WRK-VALOR * 1,10
WHEN 'RJ'
COMPUTE WRK-FRETE = WRK-VALOR * 1,15
WHEN 'MG'
COMPUTE WRK-FRETE = WRK-VALOR * 1,20
WHEN OTHER
DISPLAY 'NAO PODEMOS ENTREGAR NESSE ESTADO'
END-EVALUATE.
DISPLAY '==========================='.
IF WRK-FRETE NOT EQUAL 0
DISPLAY 'VALOR DO PRODUTO COM FRETE ' WRK-FRETE
END-IF.
DISPLAY '==========================='.
STOP RUN.