Home   Easy-Code    Forum  Updater 
Twitter Facebook



Program to find out the number of vowel characters in a text which is stored in a text file)np program for telephone bill.using cobol

Critics Rating:

Users Rating:

*(PROGRAM TO FIND OUT THE NUMBER OF VOWEL CHARACTERS IN A TEXT WHICH IS

*   STORED IN A TEXT FILE)NP.

*       PROGRAM FOR TELEPHONE BILL.

***********************************************************************

   IDENTIFICATION DIVISION.

   PROGRAM-ID.

   ENVIRONMENT DIVISION.

   INPUT-OUTPUT SECTION.

   FILE-CONTROL.

      SELECT DATAFILE ASSIGN TO DISK

      ORGANIZATION IS LINE SEQUENTIAL.      

   DATA DIVISION.

   FILE SECTION.

   FD DATAFILE

      LABEL RECORDS ARE STANDARD

      VALUE OF FILE-ID IS "TBILL.DAT".

   01 TBILL.

    02 TNO PIC 9(6).

    02 CNAME PIC X(10).

    02 EXCHAN PIC X(10).

    02 ADD1 PIC X(10).

    02 ADD2    PIC X(10).

    02 ADD3    PIC X(10).

    02 PCALLS PIC 9(5).

    02 CCALLS PIC 9(5).

    02 GCALLS PIC 9(5).

   WORKING-STORAGE SECTION.

   01 HEAD1.

    02 F PIC X(5) VALUE SPACES.

    02 F PIC X(27) VALUE "EXCHANGE".

    02 F PIC X(30) VALUE "TELEPHONE NUMBER".

    02 F PIC X(12) VALUE "BILL-DATE".

   01 HEAD2.

    02 F PIC X(5) VALUE SPACES.

    02 F PIC X(25) VALUE "ADDRESS :".

    02 F PIC X(28) VALUE "OLD METER READING".

    02 F PIC X(20) VALUE "NEW METER READING".

   77 EOF PIC A VALUE "N".

   77 P PIC Z(6).

   77 D PIC Z(5).

   77 AMT PIC 9(4)V99.

   77 TOT PIC 9(4)V99.

   77 W PIC Z(3)9.99.

   PROCEDURE DIVISION.

   MAIN-PARA.

      OPEN INPUT DATAFILE.

      PERFORM X-PARA UNTIL EOF = "Y".

      DISPLAY (1 , 1) ERASE.

      CLOSE DATAFILE.

      STOP RUN.

   X-PARA.

      READ DATAFILE RECORD AT END MOVE "Y" TO EOF.

      IF (EOF NOT = "Y")

       PERFORM Y-PARA.

   Y-PARA.

      DISPLAY (1 , 1) ERASE.

      DISPLAY (3 , 30) "TELECOM DEPARTMENT.".

      DISPLAY (5 , 33) "EAST GODAVARI.".

      DISPLAY (8 , 1) HEAD1.

      DISPLAY (11 , 1) HEAD2.

      DISPLAY (17 , 5) "GROSS CALLS : ".

      DISPLAY (17 , 47) "BILL AMOUNT : ".

      DISPLAY (19 , 47) "RENTAL CHARGE : 250.00".

      DISPLAY (21 , 47) "TOTAL : ".

      DISPLAY (9 , 6) EXCHAN.

      MOVE TNO TO P.

      DISPLAY (9 , 36) P.

      DISPLAY (9 , 63) "02-04-2001".

      DISPLAY (11 , 16) CNAME.

      DISPLAY (12 , 16) ADD1.

      DISPLAY (13 , 16) ADD2.

      DISPLAY (14 , 16) ADD3.

      MOVE PCALLS TO D.

      DISPLAY (12 , 37) D.

      MOVE CCALLS TO D.

      DISPLAY (12 , 65) D.

      MOVE GCALLS TO D.

      DISPLAY (17 , 19) D.

      COMPUTE AMT = GCALLS * 0.6.

      COMPUTE TOT = AMT + 250.00.

      MOVE AMT TO W.

      DISPLAY (17 , 63) W.

      MOVE TOT TO W.

      DISPLAY (21 , 63) W.

      DISPLAY (24 , 45) "PRESS ANY KEY TO CONTINUE....".

      ACCEPT W.

Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.