fork download
  1. Identification Division.
  2. Program-Id. Exer6.
  3.  
  4. Data Division.
  5. Working-Storage Section.
  6. 77 num Pic 99.
  7. 77 grade Pic 999.
  8. 77 sum Pic 9999.
  9. 77 ave Pic 999v99.
  10. 77 nAve Pic 999.99.
  11. 77 ctr Pic 99.
  12. 77 edit2 Pic ZZ9.99.
  13.  
  14. Procedure Division.
  15. Main.
  16. Move 0 to num.
  17. move 0 to sum.
  18. move 0 to ave.
  19. move 0 to nAve.
  20. move 0 to ctr.
  21. move 0 to edit2.
  22.  
  23. display (5 1) "Enter Number of quizzes: ".
  24. Accept (5 26) num.
  25. Display (8 1) "Quizzes".
  26. Display " ".
  27. Perform sum-rtn until ctr=num.
  28. compute ave = sum / num.
  29. move ave to edit2.
  30. Display "The average grade is: " edit2.
  31. Stop Run.
  32.  
  33. Sum-rtn.
  34. add 1 to ctr.
  35. accept grade.
  36. compute sum = sum + grade.
  37.  
  38.  
  39.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cbl:     8: error: syntax error, on or before 'sum'
stdout
Standard output is empty