identification division.
program-id. medias.
author. jorgefox
data division.
working-storage section.
01 aluno occurs 10 times.
05 codigo pic 9999 values zero.
05 nome pic x(50) values spaces.
05 notas pic 99v99 value zero occurs 4 times.
05 media pic 99v99 value zero.
77 i pic 99 values zero.
77 j pic 99 values zero.
77 lc pic 9999 value zero.
77 opcao pic x value space.
procedure division.
inicio.
perform varying i from 1 by 1 until i>3
display erase
display "Codigo : " at 0510
display "nome : " at 0610
display "*********Notas*********" at 0710
accept codigo(i) at 0520
accept nome(i) at 0620
display " " at 0809
move 0910 to lc
perform varying j from 1 by 1 until j>4
add 100 to lc
display "nota " at lc j
add 10 to lc
accept notas(i,j) at lc
subtract 10 from lc
add notas(i,j) to media(i)
end-perform
divide media(i) by 4 giving media(i)
end-perform
perform varying i from 1 by 1 until i>3
display erase
display "Codigo : " at 0510 codigo(i)
display "nome : " at 0610 nome(i)
display "*********Notas*********" at 0710
display " " at 0809
move 0910 to lc
perform varying j from 1 by 1 until j>4
add 100 to lc
display "nota " at lc j
add 10 to lc
display notas(i,j) at lc
subtract 10 from lc
end-perform
add 100 to lc
display "Media : " at lc media(i)
display "Proximo" at 1610
accept opcao at 1621
end-perform
stop run.
Agora só me resta aprender para a prova de quinta-feira...
ResponderExcluir