Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

* Complete the COBOL program to produce a cover sheet * with the following infor

ID: 3877570 • Letter: #

Question

      * Complete the COBOL program to produce a cover sheet
      * with the following information:
      *                    Student Name
      *                    Course and section
      *                    Assignment number
      *                    Due Date 1/24/18
      *                    Grade ___________
      *
      * The above information must be centered on the paper.
      * Hand in the cover sheet and the completed Cobol porgram
      *
       identification division.
       program-id. cover.
       environment division.

       configuration section.
       source-computer. ibm-pc.
       object-computer. ibm-pc.

       input-output section.
       file-control.
           select file-out assign to printer, "h:out1.txt".

       data division.
       file section.
       fd file-out label records are omitted.
       01 record-out   pic x(80).

       working-storage section.
       01 line1-out.
           05   filler    pic x(30) value spaces.
           05   filler    pic x(15) value 'John Q. Student'.
           05   filler    pic x(35) value spaces.
       01 line2-out.
           05   filler    pic x(30) value spaces.
           05   filler    pic x(14) value 'csc-170 sec 01'.
           05   filler    pic x(36) value spaces.

      * additional working storage to complete the cover sheet

       procedure division.
       100-main-module.
           open output file-out.

           move spaces to record-out.

           perform 15 times
           write record-out
           end-perform.

           write record-out from line1-out
                 after advancing 2 lines.
           write record-out from line2-out
                  after advancing 2 lines.

      * additional write statement to complete the cover sheet


           close file-out.
           stop run.

Explanation / Answer

identification division.

program-id. cover.

environment division.

configuration section.

source-computer. ibm-pc.

object-computer. ibm-pc.

input-output section.

file-control.

select file-out assign to printer, "h:out1.txt".

data division.

file section.

fd file-out label records are omitted.

01 record-out pic x(80).

working-storage section.

01 line1-out.

05 filler pic x(30) value spaces.

05 filler pic x(15) value 'John Q. Student'.

05 filler pic x(35) value spaces.

01 line2-out.

05 filler pic x(30) value spaces.

05 filler pic x(14) value 'csc-170 sec 01'.

05 filler pic x(36) value spaces.

01 line3-out.

05 filler pic x(30) value spaces.

05 filler pic x(10) value 'csc1700052'.

05 filler pic x(40) value spaces.

01 line4-out.

05 filler pic x(30) value spaces.

05 filler pic x(12) value 'DueD-1/24/18'.

05 filler pic x(38) value spaces.

01 line5-out.

05 filler pic x(30) value spaces.

05 filler pic x(07) value 'Grade- '.

05 filler pic x(43) value spaces.

  

procedure division.

100-main-module.

open output file-out.

move spaces to record-out

perform 15 times

write record-out

end-perform.

write record-out from line1-out

after advancing 2 lines.

write record-out from line2-out

after advancing 2 lines.

write record-out from line3-out

after advancing 2 lines.

write record-out from line4-out

after advancing 2 lines.

close file-out.

stop run.