--%>

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 : Describe File system File system : The

    File system: The operating system makes it possible to utilize space on a computer's disk drives by imposing a structured file system on disk storage. Each and every file system contains its own conventions for the manner in which the files are named,

  • Q : Define Delegation Delegation : The

    Delegation: The procedure by which an object passes on a message has received to a sub-ordinate object. When inheritance is not accessible in a programming language, then delegation is the most viable option for ignoring code duplication and promoting

  • Q : CORBA In what respects did CORBA seek

    In what respects did CORBA seek to improve on technologies such as SunRPC?

  • Q : Explain Imperative programming

    Imperative programming: The style of programming generally related with languages such as FORTRAN, C, Pascal and so forth. Imperative programming is differentiated from functional programming in that the previous is strongly tied to the idea of variab

  • Q : Define the term Sound card Define the

    Define the term Sound card: It is a hardware device employed to turn digital data into sound.

  • Q : What is MIME MIME : Multipurpose

    MIME: Multipurpose Internet Mail Extensions (abbreviated as MIME) are rules which make it possible to utilize electronic mail to send content other than the simple text.

  • Q : Explain the difference between RAM and

    Explain the difference between RAM and ROM?

  • Q : Define Object-oriented language

    Object-oriented language: Programming languages like Java and C++ which permit the solution to a trouble to be stated in terms of objects that belong to the classes.

  • Q : Explain Cast Cast : Where Java does not

    Cast: Where Java does not allow the utilization of a source value of one type, it is essential to use a cast to force the compiler to admit the use for the target type. The care must be taken with casting values of primitive types, as this frequently

  • Q : What is decimal Decimal: The number

    Decimal: The number representation in decimal is base 10. In base 10, the digits 0 to 9 are utilized. Digit positions symbolize successive powers of 10.