--%>

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

  • Q : Write a program that enters some text

    Write a program that enters some text into a char string called char text[100] and does the following: a) Calls a function called void vowels(char text[]) that prints out how many times each vowel (a/A, e/E, I/i, O/o, U/u) was foun

  • Q : Explain in process verses out of

    Explain in process verses out of process component.

  • Q : What is the way to use XForms What is

    What is the way to use XForms?

  • Q : Compute the Total Shopper Spending in

    Most of the reports produced from the system compute the total dollars in purchases for a shopper. Process the following steps to build a function named TOT_PURCH_SF which accepts a shopper id as input and returns the total dollars which the shopper has spent with com

  • Q : Simulation of artifacts in CT using

    How is Simulation of artifacts in CT is done utilizing MATLAB?

  • Q : Difference between collection and arrays

    Write the difference between collection and arrays?

  • Q : Define Property Specifications Property

    Property Specifications: Users can specify assertions using the assert(expr) statements. An assert statement is used to check if the property specified by the expression expr is valid within a state. If expr evaluates to 0, this implies that it is not

  • Q : What is Priority level Priority level :

    Priority level: Each and every thread has a priority level that point out to the scheduler where it must be placed in the pecking order for being run. The eligible un-blocked thread with a specific priority will always be run prior to an eligible thre

  • Q : Explain functionality or an API needs

    The application I am creating needs having access to functionality or an API that use needs the Nokia Vendor ID. For my application how can I have this Nokia VID?

  • Q : Differences between logical and

    What are the differences between logical and physical address spaces?