Hallo iedereen!,
Ik heb binnen een kleine 2 weken examen van Cobol85, ik zit bijna aan het eind van mijn te leren leerstof, echter 1 ding vind ik er niet in terug:
Ik kom via accept en compute statements tot een komma getal, bijvoorbeeld 55.25.
Echter wanneer ik dan dit bevel geef ( staat bijna helemaal onderaan)
display student(s)' ' totaalp ' ' buis
geeft hij mij 5525 (dus je moet maar raden het punt moet?)
alvast bedankt,
Groetjes jeroen
**ps: hieronder vindt je het programma:**
identification division.
program-id. extra.
data division.
working-storage section.
01 invoer.
02 student pic a(10) value "niets" occurs 10.
01 punt.
02 vaknr pic 999 value 1 occurs 10.
02 punten pic 999v99 value 0 occurs 10.
02 gem pic 999v99 value 0 occurs 10.
77 buis pic 999 value 0.
77 s pic 999 value 1.
77 v pic 999 value 1.
77 p pic 999 value 1.
77 g pic 999 value 1.
77 vakteller pic 999 value 0.
77 totaalp pic 999v99 value 0.
procedure division.
hoofd.
perform alles until student(s) = spaces
stop run.
alles.
display 'geef naam in '
accept student(s) no beep
if student(s) = spaces
stop run
else compute s = s + 1
perform 10 times
display ' geef punten vak ' vakteller ' in '
accept punten(p) no beep
if punten(p) < 10 compute buis = buis + 1
end-if
compute vakteller = vakteller + 1
compute p = p + 1
end-perform
end-if
move 1 to p
perform vakteller times
compute totaalp = totaalp + punten(p)
compute p = p + 1
end-perform
move 1 to s
display 'student totaal aantal buizen'
display '------------------------------------------'
display student(s)' ' totaalp ' ' buis
move 0 to buis
move 0 to vakteller
move 1 to p
move 0 to totaalp.
Ik heb binnen een kleine 2 weken examen van Cobol85, ik zit bijna aan het eind van mijn te leren leerstof, echter 1 ding vind ik er niet in terug:
Ik kom via accept en compute statements tot een komma getal, bijvoorbeeld 55.25.
Echter wanneer ik dan dit bevel geef ( staat bijna helemaal onderaan)
display student(s)' ' totaalp ' ' buis
geeft hij mij 5525 (dus je moet maar raden het punt moet?)
alvast bedankt,
Groetjes jeroen
**ps: hieronder vindt je het programma:**
identification division.
program-id. extra.
data division.
working-storage section.
01 invoer.
02 student pic a(10) value "niets" occurs 10.
01 punt.
02 vaknr pic 999 value 1 occurs 10.
02 punten pic 999v99 value 0 occurs 10.
02 gem pic 999v99 value 0 occurs 10.
77 buis pic 999 value 0.
77 s pic 999 value 1.
77 v pic 999 value 1.
77 p pic 999 value 1.
77 g pic 999 value 1.
77 vakteller pic 999 value 0.
77 totaalp pic 999v99 value 0.
procedure division.
hoofd.
perform alles until student(s) = spaces
stop run.
alles.
display 'geef naam in '
accept student(s) no beep
if student(s) = spaces
stop run
else compute s = s + 1
perform 10 times
display ' geef punten vak ' vakteller ' in '
accept punten(p) no beep
if punten(p) < 10 compute buis = buis + 1
end-if
compute vakteller = vakteller + 1
compute p = p + 1
end-perform
end-if
move 1 to p
perform vakteller times
compute totaalp = totaalp + punten(p)
compute p = p + 1
end-perform
move 1 to s
display 'student totaal aantal buizen'
display '------------------------------------------'
display student(s)' ' totaalp ' ' buis
move 0 to buis
move 0 to vakteller
move 1 to p
move 0 to totaalp.