Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IDENTIFICATION DIVISION.
- PROGRAM-ID. NOTAS.
- *
- ENVIRONMENT DIVISION.
- CONFIGURATION SECTION.
- SPECIAL-NAMES.
- DECIMAL-POINT IS COMMA.
- DATA DIVISION.
- WORKING-STORAGE SECTION.
- 01 VARIAVEIS-SISTEMA.
- 02 WS-N1 PIC 9(02)V9 VALUE ZEROS.
- 02 WS-N2 PIC 9(02)V9 VALUE ZEROS.
- 02 WS-N3 PIC 9(02)V9 VALUE ZEROS.
- 02 WS-N4 PIC 9(02)V9 VALUE ZEROS.
- 02 WS-MEDIA PIC 9(02)V9 VALUE ZEROS.
- 02 WS-MEDIA-FINAL PIC ZZ,Z.
- 02 WS-LINHA PIC 9(02) VALUE ZEROS.
- 02 WS-LIMPA PIC X(30) VALUE SPACES.
- 02 WS-LIMPA-MSG PIC X(66) VALUE SPACES.
- 02 RESPOSTA PIC A.
- 02 CODIGO PIC X(03) VALUE "SIM".
- 02 WS-PAUSA PIC X(01).
- 01 WS-DATA.
- 02 WS-ANO PIC 9(02) VALUE ZEROS.
- 02 WS-MES PIC 9(02) VALUE ZEROS.
- 02 WS-DIA PIC 9(02) VALUE ZEROS.
- 01 WS-HORA.
- 02 WS-HOR PIC 9(02) VALUE ZEROS.
- 02 WS-MIN PIC 9(02) VALUE ZEROS.
- 02 WS-SEG PIC 9(02) VALUE ZEROS.
- 02 WS-CSE PIC 9(02) VALUE ZEROS.
- SCREEN SECTION.
- 01 SS-LIMPA-TELA.
- 02 BLANK SCREEN.
- 01 SS-JANELA.
- 02 BLANK SCREEN.
- 02 LINE 02 COLUMN 01 VALUE "+------------------------------------".
- 02 LINE 02 COLUMN 41 VALUE "------------------------------------+".
- 02 LINE 03 COLUMN 01 VALUE "+ ".
- 02 LINE 03 COLUMN 41 VALUE " +".
- 02 LINE 04 COLUMN 01 VALUE "+------------------------------------".
- 02 LINE 04 COLUMN 41 VALUE "------------------------------------+".
- 02 LINE 05 COLUMN 01 VALUE "+ ".
- 02 LINE 05 COLUMN 41 VALUE " +".
- 02 LINE 06 COLUMN 01 VALUE "+ ".
- 02 LINE 06 COLUMN 41 VALUE " +".
- 02 LINE 07 COLUMN 01 VALUE "+ ".
- 02 LINE 07 COLUMN 41 VALUE " +".
- 02 LINE 08 COLUMN 01 VALUE "+ ".
- 02 LINE 08 COLUMN 41 VALUE " +".
- 02 LINE 09 COLUMN 01 VALUE "+ ".
- 02 LINE 09 COLUMN 41 VALUE " +".
- 02 LINE 10 COLUMN 01 VALUE "+ ".
- 02 LINE 10 COLUMN 41 VALUE " +".
- 02 LINE 11 COLUMN 01 VALUE "+ ".
- 02 LINE 11 COLUMN 41 VALUE " +".
- 02 LINE 12 COLUMN 01 VALUE "+ ".
- 02 LINE 12 COLUMN 41 VALUE " +".
- 02 LINE 13 COLUMN 01 VALUE "+ ".
- 02 LINE 13 COLUMN 41 VALUE " +".
- 02 LINE 14 COLUMN 01 VALUE "+ ".
- 02 LINE 14 COLUMN 41 VALUE " +".
- 02 LINE 15 COLUMN 01 VALUE "+ ".
- 02 LINE 15 COLUMN 41 VALUE " +".
- 02 LINE 16 COLUMN 01 VALUE "+ ".
- 02 LINE 16 COLUMN 41 VALUE " +".
- 02 LINE 17 COLUMN 01 VALUE "+ ".
- 02 LINE 17 COLUMN 41 VALUE " +".
- 02 LINE 18 COLUMN 01 VALUE "+ ".
- 02 LINE 18 COLUMN 41 VALUE " +".
- 02 LINE 19 COLUMN 01 VALUE "+ ".
- 02 LINE 19 COLUMN 41 VALUE " +".
- 02 LINE 20 COLUMN 01 VALUE "+ ".
- 02 LINE 20 COLUMN 41 VALUE " +".
- 02 LINE 21 COLUMN 01 VALUE "+ ".
- 02 LINE 21 COLUMN 41 VALUE " +".
- 02 LINE 22 COLUMN 01 VALUE "+------------------------------------".
- 02 LINE 22 COLUMN 41 VALUE "------------------------------------+".
- 02 LINE 23 COLUMN 01 VALUE "+ MENSAGEM: [ ".
- 02 LINE 23 COLUMN 41 VALUE " ]+".
- 02 LINE 24 COLUMN 01 VALUE "+------------------------------------".
- 02 LINE 24 COLUMN 41 VALUE "------------------------------------+".
- 01 SS-TITULO.
- 02 LINE 02 COLUMN 30 VALUE "C O N T R O L E D E M E D I A S".
- PROCEDURE DIVISION.
- INICIO.
- * DISPLAY (01, 01) ERASE.
- DISPLAY SS-LIMPA-TELA.
- * DISPLAY SS-JANELA.
- DISPLAY SS-TITULO.
- * ACCEPT WS-DATA FROM DATE.
- * ACCEPT WS-HORA FROM TIME.
- * DISPLAY JANELA.
- * DISPLAY (23, 69) WS-DIA "/" WS-MES "/20" WS-ANO.
- * DISPLAY (23, 58) WS-HOR ":" WS-MIN ":" WS-SEG.
- * PERFORM ROT-LIMPA-TELA.
- PERFORM ROT-JANELA.
- * PERFORM ROT-TITULO.
- PERFORM ROT-MOSTRA-DADOS.
- PERFORM ROT-PREENCHE-NOTAS.
- PERFORM ROT-CALCULA-MEDIA.
- * PERFORM 050-LIMPA-DADOS.
- ROT-MOSTRA-DADOS.
- DISPLAY(06, 07) 'NOTA 1: '.
- DISPLAY(07, 07) 'NOTA 2: '.
- DISPLAY(08, 07) 'NOTA 3: '.
- DISPLAY(09, 07) 'NOTA 4: '.
- DISPLAY(10, 07) 'MEDIA.: '.
- ROT-PREENCHE-NOTAS.
- ACCEPT (06, 15) WS-N1 WITH PROMPT.
- ACCEPT (07, 15) WS-N2 WITH PROMPT.
- ACCEPT (08, 15) WS-N3 WITH PROMPT.
- ACCEPT (09, 15) WS-N4 WITH PROMPT.
- ROT-CALCULA-MEDIA.
- COMPUTE WS-MEDIA = (WS-N1 + WS-N2 + WS-N3 + WS-N4)/4.
- MOVE WS-MEDIA TO MFINAL.
- DISPLAY (10, 32) MFINAL.
- IF WS-MEDIA < 7,0 AND WS-MEDIA > 3,9
- * DISPLAY TELA-COMP1
- DISPLAY (23, 14) "PROVA FINAL "
- ACCEPT (08, 32) WS-PF WITH PROMPT
- COMPUTE WS-MEDIA = (WS-MEDIA + WS-PF)/2
- MOVE WS-MEDIA TO MFINAL
- DISPLAY (10, 32) MFINAL.
- IF WS-MEDIA = 7 OR WS-MEDIA > 7
- DISPLAY (23, 14) "APROVADO - Tecle ENTER. ".
- IF WS-MEDIA < 7
- DISPLAY (23, 14) "REPROVADO - Tecle ENTER. ".
- ACCEPT (23, 41) WS-PAUSA.
- ROT-SAIR-OU-NAO.
- DISPLAY(23, 14) "Deseja recalcular? (S/N) ".
- ACCEPT(23, 39) RESPOSTA.
- IF RESPOSTA = "N" OR "n"
- MOVE "NAO" TO CODIGO
- GO TO ROT-FIM
- ELSE IF RESPOSTA = "S" OR "s"
- NEXT SENTENCE
- ELSE IF RESPOSTA NOT EQUAL TO "S" OR "s" OR "N" OR "n"
- DISPLAY(23, 14) "Digitar (S/N) ou (s/n): "
- ACCEPT(23, 37) RESPOSTA
- DISPLAY(23, 14) " ".
- ROT-LIMPA-TELA.
- DISPLAY(01, 01) ERASE.
- ROT-LIMPA-DADOS.
- DISPLAY (06, 32) WS-LIMPA.
- DISPLAY (07, 32) WS-LIMPA.
- DISPLAY (08, 32) WS-LIMPA.
- DISPLAY (10, 32) WS-LIMPA.
- DISPLAY (23, 14) " ".
- GO TO INICIO.
- ROT-TELA-FIM.
- DISPLAY(10, 20) '***************************************'.
- DISPLAY(11, 20) '* *'.
- DISPLAY(12, 20) '* DESENVOLVIDO POR *'.
- DISPLAY(13, 20) '* *'.
- DISPLAY(14, 20) '* MARCO ANTONIO CUNHA DA SILVA *'.
- DISPLAY(15, 20) '* *'.
- DISPLAY(16, 20) '* *'.
- DISPLAY(17, 20) '***************************************'.
- ***---------- FIM DO PROGRAMA NOTAS ---------***
- ROT-FIM.
- PERFORM ROT-LIMPA-TELA.
- DISPLAY ROT-TELA-FIM.
- STOP RUN.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement