Problem on COBOL source code errors

There are many errors in the following COBOL source code. Identify the errors and rewrite the program so that it contains no errors:
IDENTIFICATION DIVISION   (Full stop required)
PROGRAM ID. ERRORS-EXAMPLE.
DATA DIVISION    (Full stop required)
77 ITEM-DESC PIC X20. [ X(20) required for Picture to define]
77 ITEM COST PIC 999V99. [ITEM-COST required for the Variable Name.]
77 VAT 999V99.  (PIC required for Variable definition)
77 TOTAL PIC 999V99.
PROCEDURE-DIVISION.
BILL-SEQ  (Paragraph names start in Column 8 and require Full stop )
MOVE 0 TO TOTAL.
    INPUT ITEM-DESC  (these 2 are Variables not Files, cannot be in INPUT mode)
    INPUT ITEM-COST.
INPUT-ITER.
    IF ITEM-COST = 0 GOTO INPUT-END  (INPUT-END  not declared)
        ADD ITEM-COST TO TOTAL (must come after ACCEPT Item-cost)
        ACCEPT ITEM-DESC
        ACCEPT ITEM-COST
        GO TO INPUT ITER. (need to use INPUT-ITER paragraph name. )
    VAT = 0.15 X TOTAL (Full stop required and COMPUTE Required for expression)
    ADD VAT TO TOTAL (Full stop required)
    DISPLAY OUTPUT TOTAL (OUTPUT can’t use for variables and Full stop required)
    STOP-RUN. (wrong syntax, it is STOP RUN not STOP-RUN)
BILL-END (STOP RUN is last statement, Bill-end comes before that)

E

Expert

Verified

IDENTIFICATION DIVISION.
PROGRAM-ID. ERRORS-EXAMPLE.

DATA DIVISION.
WORKING-STORAGE SECTION.
77 ITEM-DESC PIC X(20).
77 ITEM-COST PIC 999V99.
77 VAT PIC 999V99.
77 TOTAL PIC 999V99.

PROCEDURE DIVISION.
BILL-SEQ.
       MOVE 0 TO TOTAL.
       ACCEPT ITEM-DESC.
       ACCEPT ITEM-COST.
INPUT-ITER.
       IF ITEM-COST = 0
       GOTO INPUT-END.
       ADD ITEM-COST TO TOTAL.
      
       ACCEPT ITEM-DESC.
       ACCEPT ITEM-COST.

       GO TO INPUT-ITER.

INPUT-END.

       COMPUTE VAT = 0.15 * TOTAL.
       ADD VAT TO TOTA.
       DISPLAY “OUTPUT” TOTAL.

 
  BILL-END.
       STOP-RUN.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.